Skip to content
Browse files

Merge pull request #9902 from robertomiranda/fix-release-task

Fix update_version_rb task
  • Loading branch information...
2 parents 0c7a283 + 7142e92 commit d28247bf567e16e63bb770003f8b97b72d5668fa @guilleiguaran guilleiguaran committed Mar 24, 2013
Showing with 2 additions and 14 deletions.
  1. +2 −14 tasks/release.rb
View
16 tasks/release.rb
@@ -23,20 +23,8 @@
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

0 comments on commit d28247b

Please sign in to comment.
Something went wrong with that request. Please try again.