Skip to content

Commit 128a211

Browse files
authored
Merge pull request #20 from dry-rb/mri-2.4
Support for MRI 2.4
2 parents 8567bac + 6abde41 commit 128a211

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ script:
88
rvm:
99
- '2.2'
1010
- '2.3.0'
11+
- '2.4.0'
1112
# - rbx-2
1213
- ruby-head
1314
- jruby-9.1.0.0

Gemfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ gemspec
55

66
group :benchmarks do
77
gem "benchmark-ips", "~> 2.5"
8-
gem "activesupport", "< 5"
8+
9+
if RUBY_VERSION < "2.4"
10+
gem "activesupport", "< 5"
11+
else
12+
gem "activesupport"
13+
end
14+
915
gem "active_attr"
1016
gem "anima"
1117
gem "attr_extras"

lib/dry/initializer/plugins/type_constraint.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ def call
1111
ivar = :"@#{rename}"
1212
lambda do |*|
1313
value = instance_variable_get(ivar)
14-
return if value == Dry::Initializer::UNDEFINED
15-
instance_variable_set ivar, type.call(value)
14+
15+
if value != Dry::Initializer::UNDEFINED
16+
instance_variable_set ivar, type.call(value)
17+
end
1618
end
1719
end
1820
end

0 commit comments

Comments
 (0)