aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/app_base.rb21
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile27
2 files changed, 25 insertions, 23 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 4f791a64e6..481fa95068 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -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')
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index 8131fb922d..0cee7deb72 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -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 -%> \ No newline at end of file