From 3f65b919e010e490bba8cd74e565f36df477ab4d Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Mon, 28 Nov 2011 14:48:28 -0700 Subject: [PATCH] Ensure that RVM version strings can be converted to RubyGems format. References #56 --- libraries/chef_rvm_set_helpers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/chef_rvm_set_helpers.rb b/libraries/chef_rvm_set_helpers.rb index 67e1d60b..63924386 100644 --- a/libraries/chef_rvm_set_helpers.rb +++ b/libraries/chef_rvm_set_helpers.rb @@ -3,7 +3,8 @@ module RVM module SetHelpers def rvm_do(user = nil) # Use Gem's version comparing code to compare the two strings - if Gem::Version.new(VersionCache.fetch_version(user)) < Gem::Version.new("1.8.6") + rvm_version = VersionCache.fetch_version(user).gsub(/(-|_|#)/, '.') + if Gem::Version.new(rvm_version) < Gem::Version.new("1.8.6") "exec" else "do"