Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #580

Merged
merged 1 commit into from Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -185,7 +185,7 @@ Any violations of this scheme are considered to be bugs.

### Fixed

* [#409](https://github.com/hashie/hashie/pull/409): Fixed Railtie detection for projects where Rails is defined but Railties are not availble - [@CallumD](https://github.com/callumd).
* [#409](https://github.com/hashie/hashie/pull/409): Fixed Railtie detection for projects where Rails is defined but Railties are not available - [@CallumD](https://github.com/callumd).
* [#411](https://github.com/hashie/hashie/pull/411): Fixed a performance regression from 3.4.3 that caused a 10x slowdown in OmniAuth - [@michaelherold](https://github.com/michaelherold).

## [3.5.3] - 2017-02-11
Expand Down Expand Up @@ -464,7 +464,7 @@ Any violations of this scheme are considered to be bugs.

### Fixed

* [#131](https://github.com/hashie/hashie/pull/131): Added IgnoreUndeclared, an extension to silently ignore undeclared properties at intialization - [@righi](https://github.com/righi).
* [#131](https://github.com/hashie/hashie/pull/131): Added IgnoreUndeclared, an extension to silently ignore undeclared properties at initialization - [@righi](https://github.com/righi).
* [#138](https://github.com/hashie/hashie/pull/138): Added Hashie::Rash, a hash whose keys can be regular expressions or ranges - [@epitron](https://github.com/epitron).
* [#144](https://github.com/hashie/hashie/issues/144): Fixed regression invoking `to_hash` with no parameters - [@mbleigh](https://github.com/mbleigh).

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -626,7 +626,7 @@ my_gem.dependencies.class #=> MyGem

_How does Mash handle key types which cannot be symbolized?_

Mash preserves keys which cannot be converted *directly* to both a string and a symbol, such as numeric keys. Since Mash is conceived to provide psuedo-object functionality, handling keys which cannot represent a method call falls outside its scope of value.
Mash preserves keys which cannot be converted *directly* to both a string and a symbol, such as numeric keys. Since Mash is conceived to provide pseudo-object functionality, handling keys which cannot represent a method call falls outside its scope of value.

```ruby
Hashie::Mash.new('1' => 'one string', :'1' => 'one sym', 1 => 'one num')
Expand Down Expand Up @@ -1106,7 +1106,7 @@ mapper["Get off my lawn!"] # => "Forget your lawn, old man!"
If this value is too low or too high for your needs, you can tune it by setting: `rash.optimize_every = n`.

## Mascot
[![eierlegende Wollmilchsau](./mascot.svg)](https://en.wiktionary.org/wiki/eierlegende_Wollmilchsau) Meet Hashie's "offical" mascot, the [eierlegende Wollmilchsau](https://en.wiktionary.org/wiki/eierlegende_Wollmilchsau)!
[![eierlegende Wollmilchsau](./mascot.svg)](https://en.wiktionary.org/wiki/eierlegende_Wollmilchsau) Meet Hashie's "official" mascot, the [eierlegende Wollmilchsau](https://en.wiktionary.org/wiki/eierlegende_Wollmilchsau)!

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion lib/hashie/dash.rb
Expand Up @@ -10,7 +10,7 @@ module Hashie
# lightweight data object that needs even fewer options and
# resources than something like a DataMapper resource.
#
# It is preferrable to a Struct because of the in-class
# It is preferable to a Struct because of the in-class
# API for defining properties as well as per-property defaults.
class Dash < Hash
include Hashie::Extensions::PrettyInspect
Expand Down
2 changes: 1 addition & 1 deletion lib/hashie/extensions/deep_locate.rb
@@ -1,7 +1,7 @@
module Hashie
module Extensions
module DeepLocate
# The module level implementation of #deep_locate, incase you do not want
# The module level implementation of #deep_locate, in case you do not want
# to include/extend the base datastructure. For further examples please
# see #deep_locate.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/hashie/extensions/method_access.rb
Expand Up @@ -241,7 +241,7 @@ def self.included(base)
end

# MethodOverridingInitializer allows you to override default hash
# methods when passing in values from an existing hash. The overriden
# methods when passing in values from an existing hash. The overridden
# methods are aliased with two leading underscores.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/hashie/mash.rb
Expand Up @@ -21,7 +21,7 @@ module Hashie
# * Bang (<tt>!</tt>): Forces the existence of this key, used for deep Mashes. Think of it
# as "touch" for mashes.
# * Under Bang (<tt>_</tt>): Like Bang, but returns a new Mash rather than creating a key.
# Used to test existance in deep Mashes.
# Used to test existence in deep Mashes.
#
# == Basic Example
#
Expand Down
2 changes: 1 addition & 1 deletion spec/hashie/dash_spec.rb
Expand Up @@ -180,7 +180,7 @@ class DashMessageOptionWithoutRequiredTest < Hashie::Dash
expect(DeferredTest.new[:created_at]).to be_instance_of(Time)
end

it 'does not evalute proc after subsequent reads' do
it 'does not evaluate proc after subsequent reads' do
deferred = DeferredTest.new
expect(deferred[:created_at].object_id).to eq deferred[:created_at].object_id
end
Expand Down
6 changes: 3 additions & 3 deletions spec/hashie/extensions/ignore_undeclared_spec.rb
Expand Up @@ -5,18 +5,18 @@
class ForgivingTrash < Hashie::Trash
include Hashie::Extensions::IgnoreUndeclared
property :city
property :state, from: :provence
property :state, from: :province
property :str_state, from: 'str_provence'
end

subject { ForgivingTrash }

it 'silently ignores undeclared properties on initialization' do
expect { subject.new(city: 'Toronto', provence: 'ON', country: 'Canada') }.to_not raise_error
expect { subject.new(city: 'Toronto', province: 'ON', country: 'Canada') }.to_not raise_error
end

it 'works with translated properties (with symbol keys)' do
expect(subject.new(provence: 'Ontario').state).to eq('Ontario')
expect(subject.new(province: 'Ontario').state).to eq('Ontario')
end

it 'works with translated properties (with string keys)' do
Expand Down
2 changes: 1 addition & 1 deletion spec/hashie/extensions/mash/define_accessors_spec.rb
Expand Up @@ -55,7 +55,7 @@
describe 'this subclass' do
it_behaves_like 'class with dynamically defined accessors'

describe 'when accessors are overrided in class' do
describe 'when accessors are overridden in class' do
before do
subject.class_eval do
def foo
Expand Down
4 changes: 2 additions & 2 deletions spec/hashie/mash_spec.rb
Expand Up @@ -764,12 +764,12 @@ class SubMash < Hashie::Mash
expect(subject.production.foo).to eq config['production']['foo']
end

it 'freeze the attribtues' do
it 'freeze the attributes' do
expect { subject.production = {} }.to raise_exception(RuntimeError, /can't modify frozen/)
end
end

context 'if the fils does not exists' do
context 'if the files does not exists' do
before do
expect(File).to receive(:file?).with(path).and_return(false)
end
Expand Down
6 changes: 3 additions & 3 deletions spec/integration/rails_7/integration_spec.rb
Expand Up @@ -43,14 +43,14 @@ class HashieKlass < Hashie::Mash; end
context '#deep_transform_keys' do
let(:klass) do
Class.new(Hashie::Dash) do
property :foo_bar
property :foo_bar
property :foo_baz, required: true
end
end

subject(:hash) { klass.new(foo_bar: 'bar', foo_baz: 'baz') }

it 'sucessfully deep transforms keys' do
it 'successfully deep transforms keys' do
pending('https://github.com/hashie/hashie/issues/559')
transformed = hash.deep_transform_keys(&:to_s)
expect(transformed.keys).to all(be_a(String))
Expand Down