diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-20 16:39:02 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-20 16:39:02 -0700 |
commit | 8e86b95306c4a9a82fc4bc470412f9a9d19984d9 (patch) | |
tree | 0e3ba7ae74dc063ef34bc8fed1439d3b6c411c55 /lib | |
parent | 8ce983662cef9fa9bcaa19e0eb371c6674539734 (diff) | |
download | chef-zero-8e86b95306c4a9a82fc4bc470412f9a9d19984d9.tar.gz |
add patch to support chef_versionlcg/chef-version-support
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef_zero/chef_data/cookbook_data.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef_zero/chef_data/cookbook_data.rb b/lib/chef_zero/chef_data/cookbook_data.rb index aed625b..172b9cd 100644 --- a/lib/chef_zero/chef_data/cookbook_data.rb +++ b/lib/chef_zero/chef_data/cookbook_data.rb @@ -124,11 +124,15 @@ module ChefZero 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 |