diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-21 14:32:06 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-26 16:21:07 -0700 |
commit | 40931ba1e8c053bac06fdc5f1776fe46f68f03f1 (patch) | |
tree | 0f847feb9c38ccb84ea0236309bcc741fc5adba7 /lib/chef/cookbook | |
parent | 2a52e9171d43d79cedf55469af1a5ba73ae28011 (diff) | |
download | chef-40931ba1e8c053bac06fdc5f1776fe46f68f03f1.tar.gz |
use #any? and comment the logic
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/metadata.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index 6c5663ae40..ed55c30258 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -665,11 +665,10 @@ class Chef private def gem_dep_matches?(what, version, *deps) + # always match if we have no chef_version at all return true unless deps.length > 0 - deps.each do |dep| - return true if dep.match?(what, version) - end - return false + # match if we match any of the chef_version lines + deps.any? { |dep| dep.match?(what, version) } end def run_validation |