Skip to content

Commit

Permalink
add patch to support chef_version
Browse files Browse the repository at this point in the history
most of our metadata is the form of:

key "value"

but chef_version can be:

chef_version ">= 12.3.1", "< 13.0.0"

so we need a splat in method messing and need to shovel it into an
array.

relates to chef/chef#4081
  • Loading branch information
lamont-granquist committed Oct 20, 2015
1 parent 8ce9836 commit 8e86b95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/chef_zero/chef_data/cookbook_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ def cookbook_arg(key, cookbook, version_constraints)
self[key][cookbook] = version_constraints.first || ">= 0.0.0"
end

def method_missing(key, value = nil)
if value.nil?
def method_missing(key, *values)
if values.nil?
self[key.to_sym]
else
store key.to_sym, value
if values.length > 1
store key.to_sym, values
else
store key.to_sym, values.first
end
end
end
end
Expand Down

0 comments on commit 8e86b95

Please sign in to comment.