Skip to content

Commit

Permalink
- app generate option --skip-sprockets leaves jquery-rails gem, which…
Browse files Browse the repository at this point in the history
… relies on sprockets environment

- Remove jquery-rails if --skip-sprockets is true

Fixes rails#23431
  • Loading branch information
vipulnsward committed Feb 4, 2016
1 parent ec1b249 commit c074343
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/app_base.rb
Expand Up @@ -317,7 +317,7 @@ def coffee_gemfile_entry
end

def javascript_gemfile_entry
if options[:skip_javascript]
if options[:skip_javascript] || options[:skip_sprockets]
[]
else
gems = [coffee_gemfile_entry, javascript_runtime_gemfile_entry]
Expand Down
3 changes: 2 additions & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -385,9 +385,10 @@ def test_generator_if_skip_sprockets_is_given
assert_match(/#\s+require\s+["']sprockets\/railtie["']/, content)
end
assert_file "Gemfile" do |content|
assert_no_match(/jquery-rails/, content)
assert_no_match(/sass-rails/, content)
assert_no_match(/uglifier/, content)
assert_match(/coffee-rails/, content)
assert_no_match(/coffee-rails/, content)
end
assert_file "config/environments/development.rb" do |content|
assert_no_match(/config\.assets\.debug = true/, content)
Expand Down

0 comments on commit c074343

Please sign in to comment.