diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-03-28 16:35:20 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-03-28 16:44:36 -0500 |
commit | 59d20af2238f7ab553f41b96282722889d8d4393 (patch) | |
tree | b6d0d96b3a9dee8b3387488d7384fb54b2c58725 | |
parent | 69c6513616bf92d5d73867a201bf92dc39ec4a07 (diff) | |
download | rails-59d20af2238f7ab553f41b96282722889d8d4393.tar.gz rails-59d20af2238f7ab553f41b96282722889d8d4393.tar.bz2 rails-59d20af2238f7ab553f41b96282722889d8d4393.zip |
Add better comments to assets gems
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 25baa470d7..7971accef3 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -179,16 +179,22 @@ module Rails gemfile = if options.dev? || options.edge? <<-GEMFILE.gsub(/^ {12}/, '') - # Gems used for assets + # Use edge version of sprockets-rails gem 'sprockets-rails', github: 'rails/sprockets-rails' + + # Use SCSS for stylesheets gem 'sass-rails', github: 'rails/sass-rails' - gem 'uglifier', '>= 1.0.3' + + # To use Uglifier as compressor for JavaScript assets + gem 'uglifier', '>= 1.3.0' GEMFILE else <<-GEMFILE.gsub(/^ {12}/, '') - # Gems used for assets + # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0.beta1' - gem 'uglifier', '>= 1.0.3' + + # To use uglifier as compressor for JavaScript assets + gem 'uglifier', '>= 1.3.0' GEMFILE end @@ -203,11 +209,19 @@ module Rails end def coffee_gemfile_entry - if options.dev? || options.edge? - "gem 'coffee-rails', github: 'rails/coffee-rails'" + gemfile = if options.dev? || options.edge? + <<-GEMFILE.gsub(/^ {12}/, '') + # Use CoffeeScript for .js.coffee assets and views + gem 'coffee-rails', github: 'rails/coffee-rails' + GEMFILE else - "gem 'coffee-rails', '~> 4.0.0.beta1'" + <<-GEMFILE.gsub(/^ {12}/, '') + # Use CoffeeScript for .js.coffee assets and views + gem 'coffee-rails', '~> 4.0.0.beta1' + GEMFILE end + + gemfile.strip_heredoc.gsub(/^[ \t]*$/, '') end def javascript_gemfile_entry @@ -215,9 +229,8 @@ module Rails unless options[:skip_javascript] <<-GEMFILE.gsub(/^ {12}/, '').strip_heredoc - #{javascript_runtime_gemfile_entry} - # Use CoffeeScript for .js.coffee assets and views #{coffee_gemfile_entry} + #{javascript_runtime_gemfile_entry} gem '#{options[:javascript]}-rails'#{args[options[:javascript]]} |