Commit f4e2402 1 parent 24ae0d0 commit f4e2402 Copy full SHA for f4e2402
File tree 6 files changed +15
-9
lines changed
6 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
sudo : false
2
2
language : ruby
3
3
rvm :
4
- - 2.2.3
4
+ - 2.2.5
5
5
- 2.3.1
6
6
script :
7
7
- bundle exec rspec spec
Original file line number Diff line number Diff line change 2
2
3
3
## next
4
4
5
+ ## 5.1
6
+
5
7
* Added ` Polymorphic ` type. See [ polymorphics.rb] ( spec/support/polymorphics.rb ) for example usage.
6
8
7
9
## 5.0.2
Original file line number Diff line number Diff line change 2
2
3
3
module Attributor
4
4
class FakeParent < ::BasicObject
5
- def method_missing ( name , *_args )
5
+ def respond_to_missing? ( _method_name )
6
+ true
7
+ end
8
+
9
+ def method_missing ( name , *_args ) # rubocop:disable Style/MethodMissing
6
10
::Kernel . warn "Warning, you have tried to access the '#{ name } ' method of the 'parent' argument of a Proc-defined :default values." \
7
11
"Those Procs should completely ignore the 'parent' attribute for the moment as it will be set to an " \
8
12
'instance of a useless class (until the framework can provide such functionality)'
Original file line number Diff line number Diff line change @@ -558,11 +558,11 @@ def validate_keys(context)
558
558
next if value . validating
559
559
end
560
560
561
- errors . push ( * attribute . validate ( value , sub_context ) )
561
+ errors . concat attribute . validate ( value , sub_context )
562
562
end
563
563
self . class . requirements . each do |requirement |
564
564
validation_errors = requirement . validate ( keys_with_values , context )
565
- errors . push ( * validation_errors ) unless validation_errors . empty?
565
+ errors . concat ( validation_errors ) unless validation_errors . empty?
566
566
end
567
567
errors
568
568
end
@@ -572,12 +572,12 @@ def validate_generic(context)
572
572
# FIXME: the sub contexts and error messages don't really make sense here
573
573
unless key_type == Attributor ::Object
574
574
sub_context = context + [ "key(#{ key . inspect } )" ]
575
- errors . push ( * key_attribute . validate ( key , sub_context ) )
575
+ errors . concat key_attribute . validate ( key , sub_context )
576
576
end
577
577
578
578
unless value_type == Attributor ::Object
579
579
sub_context = context + [ "value(#{ value . inspect } )" ]
580
- errors . push ( * value_attribute . validate ( value , sub_context ) )
580
+ errors . concat value_attribute . validate ( value , sub_context )
581
581
end
582
582
end
583
583
end
Original file line number Diff line number Diff line change @@ -142,11 +142,11 @@ def validate(context = Attributor::DEFAULT_ROOT_CONTEXT)
142
142
next if value . validating
143
143
end
144
144
145
- errors . push ( * sub_attribute . validate ( value , sub_context ) )
145
+ errors . concat sub_attribute . validate ( value , sub_context )
146
146
end
147
147
self . class . requirements . each do |req |
148
148
validation_errors = req . validate ( keys_with_values , context )
149
- errors . push ( * validation_errors ) unless validation_errors . empty?
149
+ errors . concat ( validation_errors ) unless validation_errors . empty?
150
150
end
151
151
152
152
errors
Original file line number Diff line number Diff line change 1
1
module Attributor
2
- VERSION = '5.0.2 ' . freeze
2
+ VERSION = '5.1.0 ' . freeze
3
3
end
You can’t perform that action at this time.
0 commit comments