mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix release task after ceb3b8717b
This commit is contained in:
parent
0eec487abc
commit
78defbb78e
3 changed files with 27 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
|||
module Rails
|
||||
module VERSION
|
||||
MAJOR = 4
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
PRE = "beta1"
|
||||
MAJOR = 4
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
PRE = "beta1"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -23,8 +23,25 @@ directory "pkg"
|
|||
file = Dir[glob].first
|
||||
ruby = File.read(file)
|
||||
|
||||
ruby.gsub!(/^(\s*)Gem::Version\.new .*?$/, "\\1Gem::Version.new \"#{version}\"")
|
||||
raise "Could not insert Gem::Version in #{file}" unless $1
|
||||
if framework == "rails" || framework == "railties"
|
||||
major, minor, tiny, pre = version.split('.')
|
||||
pre = pre ? pre.inspect : "nil"
|
||||
|
||||
ruby.gsub!(/^(\s*)MAJOR(\s*)= .*?$/, "\\1MAJOR = #{major}")
|
||||
raise "Could not insert MAJOR in #{file}" unless $1
|
||||
|
||||
ruby.gsub!(/^(\s*)MINOR(\s*)= .*?$/, "\\1MINOR = #{minor}")
|
||||
raise "Could not insert MINOR in #{file}" unless $1
|
||||
|
||||
ruby.gsub!(/^(\s*)TINY(\s*)= .*?$/, "\\1TINY = #{tiny}")
|
||||
raise "Could not insert TINY in #{file}" unless $1
|
||||
|
||||
ruby.gsub!(/^(\s*)PRE(\s*)= .*?$/, "\\1PRE = #{pre}")
|
||||
raise "Could not insert PRE in #{file}" unless $1
|
||||
else
|
||||
ruby.gsub!(/^(\s*)Gem::Version\.new .*?$/, "\\1Gem::Version.new \"#{version}\"")
|
||||
raise "Could not insert Gem::Version in #{file}" unless $1
|
||||
end
|
||||
|
||||
File.open(file, 'w') { |f| f.write ruby }
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
module Rails
|
||||
module VERSION
|
||||
MAJOR = 4
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
PRE = "beta1"
|
||||
MAJOR = 4
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
PRE = "beta1"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue