Skip to content

Commit 0ab290e

Browse files
authored
Merge branch 'master' into block-reload-config
2 parents 5db7fc4 + 25bc414 commit 0ab290e

7 files changed

Lines changed: 31 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 5.5.2
4+
5+
* Fix warning: ostruct was loaded from the standard library with Ruby 3.3.5 and 3.4+ ([#363](https://github.com/rubyconfig/config/pull/363))
6+
7+
## 5.5.1
8+
9+
### Documentation
10+
11+
* Fix funding_url to funding_uri in gemspec ([#361](https://github.com/rubyconfig/config/pull/361))
12+
13+
## 5.5.0
14+
15+
### New features
16+
17+
* Allow arrays to be passed through env variables ([#354](https://github.com/rubyconfig/config/pull/354))
18+
19+
### Documentation
20+
21+
* Use funding_url rather than post_install_message ([#360](https://github.com/rubyconfig/config/pull/360))
22+
* Fix typos in the tests and documentation ([#359](https://github.com/rubyconfig/config/pull/359))
23+
324
## 5.4.0
425

526
### New features
@@ -56,7 +77,7 @@
5677
* Rails versions `< 5.2` are no longer supported ([#316](https://github.com/rubyconfig/config/pull/316))
5778
* Ruby versions `< 2.6` are no longer supported ([#316](https://github.com/rubyconfig/config/pull/316))
5879
* 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:
59-
* 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`.
80+
* 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`.
6081
* 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`.
6182

6283
## 3.1.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ After installing `Config` in Rails, you will find automatically generated file t
278278

279279
### General
280280

281-
* `const_name` - name of the object holing you settings. Default: `'Settings'`
281+
* `const_name` - name of the object holding your settings. Default: `'Settings'`
282282
* `evaluate_erb_in_yaml` - evaluate ERB in YAML config files. Set to false if the config file contains ERB that should not be evaluated at load time. Default: `true`
283283
* `file_name` - name of the file to store general keys accessible in all environments. Default: `'settings'` - located at `config/settings.yml`
284284
* `dir_name` - name of the directory to store environment-specific files. Default: `'settings'` - located at `config/settings/`
@@ -436,7 +436,7 @@ ENV['Settings.section.server'] = 'google.com'
436436

437437
It won't work with arrays, though.
438438

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

441441
```ruby
442442
# Raises an error when settings are loaded

config.gemspec

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ Gem::Specification.new do |s|
1414
s.license = 'MIT'
1515
s.extra_rdoc_files = %w[README.md CHANGELOG.md CONTRIBUTING.md LICENSE.md]
1616
s.rdoc_options = ['--charset=UTF-8']
17-
s.post_install_message = "\n\e[33mThanks for installing Config\e[0m
18-
Please consider donating to our open collective to help us maintain this project.
19-
\n
20-
Donate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
2117

2218
s.metadata = {
2319
'changelog_uri' => "https://github.com/rubyconfig/config/blob/master/CHANGELOG.md",
20+
'funding_uri' => 'https://opencollective.com/rubyconfig/donate',
2421
'source_code_uri' => 'https://github.com/rubyconfig/config',
2522
'bug_tracker_uri' => 'https://github.com/rubyconfig/config/issues'
2623
}
@@ -31,6 +28,7 @@ Donate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
3128
s.required_ruby_version = '>= 2.6.0'
3229

3330
s.add_dependency 'deep_merge', '~> 1.2', '>= 1.2.1'
31+
s.add_dependency 'ostruct'
3432

3533
s.add_development_dependency 'dry-validation', *Config::DryValidationRequirements::VERSIONS
3634
s.add_development_dependency 'rake', '~> 12.0', '>= 12.0.0'

lib/config/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Config
2-
VERSION = '5.4.0'.freeze
2+
VERSION = '5.5.2'.freeze
33
end

spec/config_env_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
expect(config.world.countries.europe).to eq(0)
173173
end
174174

175-
it 'should ignore variables wit default separator' do
175+
it 'should ignore variables with default separator' do
176176
ENV['Settings.new_var'] = 'value'
177177

178178
expect(config.new_var).to eq(nil)

spec/fixtures/unsafe_load.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ test:
77
database: myapp_test
88
pool: *pool # Psych::BadAlias: Unknown alias
99
others:
10-
regex: !ruby/regexp '/https?:\/\/.*exmaple\.com/' # Tried to load unspecified class: Regexp (Psych::DisallowedClass)
10+
regex: !ruby/regexp '/https?:\/\/.*example\.com/' # Tried to load unspecified class: Regexp (Psych::DisallowedClass)
1111
date: 2021-08-03 # Tried to load unspecified class: Date (Psych::DisallowedClass)
1212
time: 2001-12-14T21:59:43.10-05:00 # Tried to load unspecified class: Time (Psych::DisallowedClass)

spec/options_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
it 'should allow to access them via object member notation' do
7171
expect(config.select).to be_nil
7272
expect(config.table).to be_nil
73-
expect(config.exit!).to be_nil
73+
expect(config.exit!).to be_nil
7474
end
7575

7676
it 'should allow to access them using [] operator' do
@@ -167,7 +167,7 @@
167167
config.reload!
168168
end
169169

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

0 commit comments

Comments
 (0)