mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix update_version_rb task
This commit is contained in:
parent
1f1adb835a
commit
7142e924b4
1 changed files with 2 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue