lib/packer/dataobject.rb in packer-config-1.5.0 vs lib/packer/dataobject.rb in packer-config-1.6.0
- old
+ new
@@ -22,10 +22,10 @@
true
end
def validate_required
self.required.each do |r|
- if (r.is_a? Array) && (r.length > 0)
+ if (r.is_a? Array) && !r.empty?
if r.length - (r - self.data.keys).length == 0
raise DataValidationError.new("Missing one required setting from the set #{r}")
end
if r.length - (r - self.data.keys).length > 1
raise DataValidationError.new("Found more than one exclusive setting in data from set #{r}")