diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-28 00:36:11 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-28 01:42:59 -0300 |
commit | 0417bc83164422119ab2dc4da92ec6ddff5a3d2f (patch) | |
tree | c665f56407e7c6a92aa0cdbeaae94b7b3007f7bc /railties/lib | |
parent | cf46c314e2909748b3a0319e3830c116fe6672da (diff) | |
download | rails-0417bc83164422119ab2dc4da92ec6ddff5a3d2f.tar.gz rails-0417bc83164422119ab2dc4da92ec6ddff5a3d2f.tar.bz2 rails-0417bc83164422119ab2dc4da92ec6ddff5a3d2f.zip |
Add coffee-rails and javascript runtime to gemfile if skip_javascript is
provided
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 63e9b720a4..25baa470d7 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -192,6 +192,13 @@ module Rails GEMFILE end + if options[:skip_javascript] + gemfile += <<-GEMFILE.gsub(/^ {12}/, '') + #{coffee_gemfile_entry} + #{javascript_runtime_gemfile_entry} + GEMFILE + end + gemfile.strip_heredoc.gsub(/^[ \t]*$/, '') end @@ -220,7 +227,7 @@ module Rails end end - def javascript_runtime_gemfile_entry(n_spaces=0) + def javascript_runtime_gemfile_entry runtime = if defined?(JRUBY_VERSION) "gem 'therubyrhino'" else @@ -228,7 +235,7 @@ module Rails end <<-GEMFILE.gsub(/^ {10}/, '') # See https://github.com/sstephenson/execjs#readme for more supported runtimes - #{" "*n_spaces}#{runtime} + #{runtime} GEMFILE end |