From 7142e924b4ea366ef4ba067cd7afe6581c98b4c4 Mon Sep 17 00:00:00 2001 From: robertomiranda Date: Sun, 24 Mar 2013 08:43:10 -0500 Subject: Fix update_version_rb task --- tasks/release.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tasks/release.rb b/tasks/release.rb index 650b381e0f..cf5b6d6843 100644 --- a/tasks/release.rb +++ b/tasks/release.rb @@ -23,20 +23,8 @@ directory "pkg" file = Dir[glob].first ruby = File.read(file) - major, minor, tiny, pre = version.split('.') - pre = pre ? pre.inspect : "nil" - - ruby.gsub!(/^(\s*)MAJOR = .*?$/, "\\1MAJOR = #{major}") - raise "Could not insert MAJOR in #{file}" unless $1 - - ruby.gsub!(/^(\s*)MINOR = .*?$/, "\\1MINOR = #{minor}") - raise "Could not insert MINOR in #{file}" unless $1 - - ruby.gsub!(/^(\s*)TINY = .*?$/, "\\1TINY = #{tiny}") - raise "Could not insert TINY in #{file}" unless $1 - - ruby.gsub!(/^(\s*)PRE = .*?$/, "\\1PRE = #{pre}") - raise "Could not insert PRE in #{file}" unless $1 + ruby.gsub!(/^(\s*)Gem::Version\.new .*?$/, "\\1Gem::Version.new \"#{version}\"") + raise "Could not insert Gem::Version in #{file}" unless $1 File.open(file, 'w') { |f| f.write ruby } end -- cgit v1.2.3