提交 78defbb7 编写于 作者: S Santiago Pastorino

Fix release task after ceb3b871

上级 0eec487a
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 @@
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
......
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册