Skip to content

Commit 49c4af4

Browse files
committed
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
1 parent e743850 commit 49c4af4

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

railties/lib/rails/generators/app_base.rb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,23 @@ def assets_gemfile_entry
179179

180180
gemfile = if options.dev? || options.edge?
181181
<<-GEMFILE.gsub(/^ {12}/, '')
182-
# Gems used only for assets and not required
183-
# in production environments by default.
184-
group :assets do
185-
gem 'sprockets-rails', github: 'rails/sprockets-rails'
186-
gem 'sass-rails', github: 'rails/sass-rails'
187-
#{coffee_gemfile_entry if options[:skip_javascript]}
188-
#{javascript_runtime_gemfile_entry(2) if options[:skip_javascript]}
189-
gem 'uglifier', '>= 1.0.3'
190-
end
182+
# Gems used for assets
183+
gem 'sprockets-rails', github: 'rails/sprockets-rails'
184+
gem 'sass-rails', github: 'rails/sass-rails'
185+
gem 'uglifier', '>= 1.0.3'
191186
GEMFILE
192187
else
193188
<<-GEMFILE.gsub(/^ {12}/, '')
194-
# Gems used only for assets and not required
195-
# in production environments by default.
196-
group :assets do
197-
gem 'sass-rails', '~> 4.0.0.beta1'
198-
#{coffee_gemfile_entry if options[:skip_javascript]}
199-
#{javascript_runtime_gemfile_entry(2) if options[:skip_javascript]}
200-
gem 'uglifier', '>= 1.0.3'
201-
end
189+
# Gems used for assets
190+
gem 'sass-rails', '~> 4.0.0.beta1'
191+
gem 'uglifier', '>= 1.0.3'
192+
GEMFILE
193+
end
194+
195+
if options[:skip_javascript]
196+
gemfile += <<-GEMFILE.gsub(/^ {12}/, '')
197+
#{coffee_gemfile_entry}
198+
#{javascript_runtime_gemfile_entry(2)}
202199
GEMFILE
203200
end
204201

0 commit comments

Comments
 (0)