aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2013-04-01 18:26:34 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2013-04-01 18:26:34 -0300
commit78defbb78ee6ddf804340a54eaad28f4e0ea723f (patch)
tree57dab8d81cdd5be3ecf70d81e1156cc310dff7bd
parent0eec487abcd08d2001809dc339e2a5db08c2dcca (diff)
downloadrails-78defbb78ee6ddf804340a54eaad28f4e0ea723f.tar.gz
rails-78defbb78ee6ddf804340a54eaad28f4e0ea723f.tar.bz2
rails-78defbb78ee6ddf804340a54eaad28f4e0ea723f.zip
Fix release task after ceb3b8717beb9818fbfbab429a8aa697591e184a
-rw-r--r--railties/lib/rails/version.rb8
-rw-r--r--tasks/release.rb21
-rw-r--r--version.rb8
3 files changed, 27 insertions, 10 deletions
diff --git a/railties/lib/rails/version.rb b/railties/lib/rails/version.rb
index 47c21b112c..fee352db5a 100644
--- a/railties/lib/rails/version.rb
+++ b/railties/lib/rails/version.rb
@@ -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
diff --git a/tasks/release.rb b/tasks/release.rb
index cf5b6d6843..0c22f812fc 100644
--- a/tasks/release.rb
+++ b/tasks/release.rb
@@ -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
diff --git a/version.rb b/version.rb
index 47c21b112c..fee352db5a 100644
--- a/version.rb
+++ b/version.rb
@@ -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