Skip to content

Commit ab7039f

Browse files
qnighypkuczynski
authored andcommitted
Fix missing new_ostruct_member in Ruby 2.7 (#255)
1 parent 5368594 commit ab7039f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ rvm:
55
- 2.4.5
66
- 2.5.3
77
- 2.6.0
8+
- 2.7.0
89
- truffleruby
910
gemfile:
1011
- gemfiles/rails_4.2.gemfile
@@ -14,7 +15,10 @@ gemfile:
1415
- gemfiles/sinatra.gemfile
1516
matrix:
1617
exclude:
17-
# truffleruby does not seem to work with Rails
18+
# Bundler 2.x coming with Ruby 2.7 does not work well with rails 4.2
19+
- rvm: 2.7.0
20+
gemfile: gemfiles/rails_4.2.gemfile
21+
# TruffleRuby does not seem to work with Rails
1822
- rvm: truffleruby
1923
gemfile: gemfiles/rails_4.2.gemfile
2024
- rvm: truffleruby

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* Get rid of unused Rails Engine class definition ([#247](https://github.com/railsconfig/config/pull/247))
88
* Require dry-validation only when schema is specified ([#253](https://github.com/railsconfig/config/pull/253))
99

10+
### Bug fixes
11+
12+
* Fix missing new_ostruct_member in Ruby 2.7 ([#255](https://github.com/railsconfig/config/pull/255))
13+
1014
### Changes
1115

1216
* Use sprockets 3.x when running unit tests for Rails 4.2 ([#256](https://github.com/railsconfig/config/pull/256))

lib/config/options.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,14 @@ def __convert(h) #:nodoc:
201201

202202
h.each do |k, v|
203203
k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)
204-
s.new_ostruct_member(k)
205204

206205
if v.is_a?(Hash)
207206
v = v["type"] == "hash" ? v["contents"] : __convert(v)
208207
elsif v.is_a?(Array)
209208
v = v.collect { |e| e.instance_of?(Hash) ? __convert(e) : e }
210209
end
211210

212-
s.send("#{k}=".to_sym, v)
211+
s[k] = v
213212
end
214213
s
215214
end

0 commit comments

Comments
 (0)