1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Cleanup the Gemfile and compute whats needed depending on whether we are on 1.8 or 1.9

This commit is contained in:
David Heinemeier Hansson 2011-04-13 21:32:41 +02:00
parent 1f4dae9daa
commit bd3b2241a4
2 changed files with 25 additions and 23 deletions

View file

@ -124,7 +124,7 @@ module Rails
entry += "\n# gem 'mysql2', :git => 'git://github.com/brianmario/mysql2.git'"
end
end
entry
entry + "\n"
end
def rails_gemfile_entry
@ -165,6 +165,25 @@ module Rails
else options[:database]
end
end
def gem_for_ruby_debugger
if RUBY_VERSION < "1.9.2"
"gem 'ruby-debug'"
else
"gem 'ruby-debug19', :require => 'ruby-debug'"
end
end
def gem_for_turn
unless RUBY_VERSION < "1.9.2"
<<-GEMFILE.strip_heredoc
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
GEMFILE
end
end
def bundle_if_dev_or_edge
bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle')

View file

@ -5,8 +5,8 @@ source 'http://rubygems.org'
<%= database_gemfile_entry -%>
# Asset template engines
gem 'json' # Not needed on Ruby 1.9
gem 'sass', :git => 'git://github.com/nex3/sass.git'
<%= "gem 'json'\n" if RUBY_VERSION < "1.9.2" -%>
gem 'sass', '~> 3.1.0.alpha'
gem 'coffee-script'
# Use unicorn as the web server
@ -15,24 +15,7 @@ gem 'coffee-script'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# To use debugger
# <%= gem_for_ruby_debugger %>
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3'
# gem 'rack-bug', :require => 'rack/bug'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :development, :test do
# Pretty printed test output for minitest on Ruby 1.9.2+
gem 'turn', :require => false
end
# Needed for guides generation
# gem "RedCloth", "~> 4.2"
<%= gem_for_turn -%>