From 5a5419c3087544b4b44521386815e15272864c59 Mon Sep 17 00:00:00 2001 From: Yudai Takada Date: Fri, 12 Apr 2024 09:04:12 +0900 Subject: [PATCH] Fix typos in the tests and documentation (#359) --- CHANGELOG.md | 2 +- README.md | 2 +- spec/config_env_spec.rb | 2 +- spec/fixtures/unsafe_load.yml | 2 +- spec/options_spec.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6319f40f..e49a63ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 119580fe..2cdc34c0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/spec/config_env_spec.rb b/spec/config_env_spec.rb index a5eee612..99e3e863 100644 --- a/spec/config_env_spec.rb +++ b/spec/config_env_spec.rb @@ -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) diff --git a/spec/fixtures/unsafe_load.yml b/spec/fixtures/unsafe_load.yml index b0921ff4..6152bb84 100644 --- a/spec/fixtures/unsafe_load.yml +++ b/spec/fixtures/unsafe_load.yml @@ -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) diff --git a/spec/options_spec.rb b/spec/options_spec.rb index fbf0b0ca..03f7b94b 100644 --- a/spec/options_spec.rb +++ b/spec/options_spec.rb @@ -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 @@ -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