From 57460b1d9627ecc2666988f1aceb0d124990d02e Mon Sep 17 00:00:00 2001 From: GriffinJ Date: Sun, 3 Nov 2019 21:18:04 -0500 Subject: [PATCH] Adding Webpacker as a dependency for Rails 6.0.z builds --- Gemfile | 2 ++ .../lib/generators/test_app_generator.rb | 11 ----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 45d29515..e9cb4e01 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ else case ENV['RAILS_VERSION'] when '6.0.0' # This will only be necessary until release 6.0.1 is published gem 'sass-rails', '~> 5' + gem 'webpacker' # This is necessary or the generator will break when /^5\./ gem 'capybara', '~> 2.18.0' gem 'sass-rails', '~> 5' @@ -47,6 +48,7 @@ else gem 'sass-rails', '>= 5.0' else gem 'sass-rails' + gem 'webpacker' end end # END ENGINE_CART BLOCK diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 8435800d..2fcb31d6 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -28,18 +28,7 @@ def inject_css end def inject_javascript - binding.pry if Rails.version =~ /^6\./ - # copy_file 'template/foo', 'app/assets/javascripts.js' - -=begin - insert_into_file 'app/javascript/packs/application.js', after: 'require("channels")' do - %( - //= require_tree . - ) - end -=end - insert_into_file 'app/assets/config/manifest.js', after: '//= link_directory ../stylesheets .css' do %( //= link_directory ../javascripts .js