Skip to content

Commit 33d0e65

Browse files
authored
Add exit! to reserved keywords (#289)
1 parent 0c8f3dd commit 33d0e65

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Changes
1010

1111
* Add JRuby 9.2 to the test matrix ([#228](https://github.com/railsconfig/config/issues/228))
12+
* Add exit! to reserved keywords ([#289](https://github.com/railsconfig/config/issues/289))
1213

1314
## 2.2.1
1415

lib/config/options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def merge!(hash)
145145
end
146146

147147
# Some keywords that don't play nicely with OpenStruct
148-
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max].freeze
148+
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max exit!].freeze
149149

150150
# An alternative mechanism for property access.
151151
# This let's you do foo['bar'] along with foo.bar.

spec/fixtures/reserved_keywords.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ count: lemon
44
zip: cherry
55
max: kumquat
66
min: fig
7+
exit!: taro

spec/options_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
expect(config.zip).to eq('cherry')
1515
expect(config.max).to eq('kumquat')
1616
expect(config.min).to eq('fig')
17+
expect(config.exit!).to eq('taro')
1718
end
1819

1920
it 'should allow to access them using [] operator' do
@@ -23,13 +24,15 @@
2324
expect(config['zip']).to eq('cherry')
2425
expect(config['max']).to eq('kumquat')
2526
expect(config['min']).to eq('fig')
27+
expect(config['exit!']).to eq('taro')
2628

2729
expect(config[:select]).to eq('apple')
2830
expect(config[:collect]).to eq('banana')
2931
expect(config[:count]).to eq('lemon')
3032
expect(config[:zip]).to eq('cherry')
3133
expect(config[:max]).to eq('kumquat')
3234
expect(config[:min]).to eq('fig')
35+
expect(config[:exit!]).to eq('taro')
3336
end
3437
end
3538

0 commit comments

Comments
 (0)