Skip to content

Commit

Permalink
Fix typos in the tests and documentation (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah authored Apr 12, 2024
1 parent fb280e6 commit 5a5419c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* Rails versions `< 5.2` are no longer supported ([#316](https://github.com/rubyconfig/config/pull/316))
* Ruby versions `< 2.6` are no longer supported ([#316](https://github.com/rubyconfig/config/pull/316))
* Support `HashSource` and `EnvSource` instances in `Config.load_files` and `Config.load_and_set_settings`. ([#315](https://github.com/rubyconfig/config/pull/315)). There are a few subtle breaking changes:
* Previously, `Config.load_files` (called from `Config.load_and_set_settings`) would call `.to_s` on each of its arguments. Now, this responsibility is defered to YAMLSource. In effect, if your application passes String or Pathname objects to `Config.load_files`, no changes are necessary, but if you were somehow relying on the `.to_s` call for some other type of object, you'll now need to call `.to_s` on that object before passing it to `Config`.
* Previously, `Config.load_files` (called from `Config.load_and_set_settings`) would call `.to_s` on each of its arguments. Now, this responsibility is deferred to YAMLSource. In effect, if your application passes String or Pathname objects to `Config.load_files`, no changes are necessary, but if you were somehow relying on the `.to_s` call for some other type of object, you'll now need to call `.to_s` on that object before passing it to `Config`.
* Before this change, `Config.load_files` would call `uniq` on its argument array. This call has been removed, so duplicate file paths are not removed before further processing. In some cases, this can cause differences in behavior since later config files override the values in earlier ones. In most cases, it's best to ensure that duplicate paths are not passed to `Config.load_files`.

## 3.1.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ ENV['Settings.section.server'] = 'google.com'

It won't work with arrays, though.

It is considered an error to use environment variables to simutaneously assign a "flat" value and a multi-level value to a key.
It is considered an error to use environment variables to simultaneously assign a "flat" value and a multi-level value to a key.

```ruby
# Raises an error when settings are loaded
Expand Down
2 changes: 1 addition & 1 deletion spec/config_env_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
expect(config.world.countries.europe).to eq(0)
end

it 'should ignore variables wit default separator' do
it 'should ignore variables with default separator' do
ENV['Settings.new_var'] = 'value'

expect(config.new_var).to eq(nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/unsafe_load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ test:
database: myapp_test
pool: *pool # Psych::BadAlias: Unknown alias
others:
regex: !ruby/regexp '/https?:\/\/.*exmaple\.com/' # Tried to load unspecified class: Regexp (Psych::DisallowedClass)
regex: !ruby/regexp '/https?:\/\/.*example\.com/' # Tried to load unspecified class: Regexp (Psych::DisallowedClass)
date: 2021-08-03 # Tried to load unspecified class: Date (Psych::DisallowedClass)
time: 2001-12-14T21:59:43.10-05:00 # Tried to load unspecified class: Time (Psych::DisallowedClass)
4 changes: 2 additions & 2 deletions spec/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
it 'should allow to access them via object member notation' do
expect(config.select).to be_nil
expect(config.table).to be_nil
expect(config.exit!).to be_nil
expect(config.exit!).to be_nil
end

it 'should allow to access them using [] operator' do
Expand Down Expand Up @@ -167,7 +167,7 @@
config.reload!
end

it 'should be overwriten by the following values' do
it 'should be overwritten by the following values' do
expect(config['tvrage']['service_url']).to eq('http://services.tvrage.com')
end

Expand Down

0 comments on commit 5a5419c

Please sign in to comment.