summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-21 14:32:06 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-26 16:21:07 -0700
commit40931ba1e8c053bac06fdc5f1776fe46f68f03f1 (patch)
tree0f847feb9c38ccb84ea0236309bcc741fc5adba7
parent2a52e9171d43d79cedf55469af1a5ba73ae28011 (diff)
downloadchef-40931ba1e8c053bac06fdc5f1776fe46f68f03f1.tar.gz
use #any? and comment the logic
-rw-r--r--lib/chef/cookbook/metadata.rb7
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