From 49c4af43ec5819d8f5c1a91f9b84296c927ce6e7 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 27 Mar 2013 15:12:26 -0400 Subject: Cosmetic cleanup of generated Gemfile - Remove obsolete/misleading comment about assets only being used production - Remove unnecessary group :assets - Eliminate blank lines if options[:skip_javascript] is not specified --- railties/lib/rails/generators/app_base.rb | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 4e05c32f74..4cd4487bdd 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -179,26 +179,23 @@ module Rails gemfile = if options.dev? || options.edge? <<-GEMFILE.gsub(/^ {12}/, '') - # Gems used only for assets and not required - # in production environments by default. - group :assets do - gem 'sprockets-rails', github: 'rails/sprockets-rails' - gem 'sass-rails', github: 'rails/sass-rails' - #{coffee_gemfile_entry if options[:skip_javascript]} - #{javascript_runtime_gemfile_entry(2) if options[:skip_javascript]} - gem 'uglifier', '>= 1.0.3' - end + # Gems used for assets + gem 'sprockets-rails', github: 'rails/sprockets-rails' + gem 'sass-rails', github: 'rails/sass-rails' + gem 'uglifier', '>= 1.0.3' GEMFILE else <<-GEMFILE.gsub(/^ {12}/, '') - # Gems used only for assets and not required - # in production environments by default. - group :assets do - gem 'sass-rails', '~> 4.0.0.beta1' - #{coffee_gemfile_entry if options[:skip_javascript]} - #{javascript_runtime_gemfile_entry(2) if options[:skip_javascript]} - gem 'uglifier', '>= 1.0.3' - end + # Gems used for assets + gem 'sass-rails', '~> 4.0.0.beta1' + gem 'uglifier', '>= 1.0.3' + GEMFILE + end + + if options[:skip_javascript] + gemfile += <<-GEMFILE.gsub(/^ {12}/, '') + #{coffee_gemfile_entry} + #{javascript_runtime_gemfile_entry(2)} GEMFILE end -- cgit v1.2.3 From 4e35dc0ebec33905a05dca1fdeecc6a39e87e9cc Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 27 Mar 2013 16:01:33 -0400 Subject: Remove buggy and unnecessary logic based on a discussion with @rafaelfranca --- railties/lib/rails/generators/app_base.rb | 7 ------- 1 file changed, 7 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 4cd4487bdd..63e9b720a4 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -192,13 +192,6 @@ module Rails GEMFILE end - if options[:skip_javascript] - gemfile += <<-GEMFILE.gsub(/^ {12}/, '') - #{coffee_gemfile_entry} - #{javascript_runtime_gemfile_entry(2)} - GEMFILE - end - gemfile.strip_heredoc.gsub(/^[ \t]*$/, '') end -- cgit v1.2.3