summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-05-02 16:14:52 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-05-02 16:14:52 -0700
commit9dd414e17a13a871649806e9d3246a8730bec3c3 (patch)
tree8e16d61dfae094ede26a1cd4515c7039511bdf7b /lib/chef/provider
parentb447bbf40017d3f8d1c172fda6c49c3e860edf24 (diff)
downloadchef-9dd414e17a13a871649806e9d3246a8730bec3c3.tar.gz
this seems both more readable and correct
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/package/rubygems.rb15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index cb3ad89bba..eb5a87099f 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -490,20 +490,9 @@ class Chef
end
end
- def target_version_already_installed?(current_version, new_version)
- match_version(current_version, new_version, false)
- end
-
- def version_requirement_satisfied?(current_version, version_requirement)
- match_version(current_version, version_requirement, true)
- end
-
- def match_version(current_version, new_version, fuzzy_match)
+ def version_requirement_satisfied?(current_version, new_version)
return false unless current_version && new_version
-
- requirement = Gem::Requirement.new(new_version)
- (fuzzy_match || requirement.exact?) &&
- requirement.satisfied_by?(Gem::Version.new(current_version))
+ Gem::Requirement.new(new_version).satisfied_by?(Gem::Version.new(current_version))
end
##