Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Be a little more forgiving when RAILS_VERSION or .rails-version does …

…not exist
  • Loading branch information...
commit 1dd534bc0b75195926be700acd1a1fc0c3434eb8 1 parent 1f8b20d
@alindeman alindeman authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 Gemfile
View
5 Gemfile
@@ -29,7 +29,8 @@ gem 'sqlite3', '~> 1.3.6'
custom_gemfile = File.expand_path("../Gemfile-custom", __FILE__)
eval File.read(custom_gemfile) if File.exist?(custom_gemfile)
-case version = ENV['RAILS_VERSION'] || File.read(File.expand_path("../.rails-version", __FILE__)).chomp
+version_file = File.expand_path("../.rails-version", __FILE__)
+case version = ENV['RAILS_VERSION'] || (File.exist?(version_file) && File.read(version_file).chomp)
when /master/
gem "rails", :git => "git://github.com/rails/rails.git"
gem "arel", :git => "git://github.com/rails/arel.git"
@@ -44,6 +45,8 @@ when /3-1-stable/
gem "rails", :git => "git://github.com/rails/rails.git", :branch => "3-1-stable"
when /3-2-stable/
gem "rails", :git => "git://github.com/rails/rails.git", :branch => "3-2-stable"
+when nil, false, ""
+ gem "rails"
else
gem "rails", version
end
Please sign in to comment.
Something went wrong with that request. Please try again.