-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduces support for sprockets 4.y.z releases #311
Changes from all commits
d9779f8
4f1c61a
2d605f6
1b48537
754b4eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,14 +34,21 @@ else | |
end | ||
|
||
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' | ||
when /^4\.2/ | ||
gem 'sass-rails', '~> 5' | ||
when /^4\./ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be removed, Core Components are no longer required to support Rails 4.y.z releases. |
||
gem 'coffee-rails', '~> 4.1.0' | ||
gem 'json', '~> 1.8' | ||
gem 'railties', '~> 4.2' | ||
gem 'responders', '~> 2.0' | ||
gem 'sass-rails', '>= 5.0' | ||
else | ||
gem 'sass-rails' | ||
gem 'webpacker' # This is necessary or the generator will break | ||
end | ||
end | ||
# END ENGINE_CART BLOCK | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,10 @@ Gem::Specification.new do |spec| | |
spec.add_dependency 'google_drive', '~> 2.1' | ||
spec.add_dependency 'googleauth', '0.6.6' | ||
spec.add_dependency 'puma', '~> 3.11' | ||
spec.add_dependency 'rails', '>= 4.2', '< 6.0' | ||
spec.add_dependency 'rails', '>= 4.2' | ||
spec.add_dependency 'ruby-box' | ||
spec.add_dependency 'signet', '~> 0.8' | ||
spec.add_dependency 'sprockets', '~> 3.7' | ||
spec.add_dependency 'sprockets' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sprockets becomes a problem with |
||
spec.add_dependency 'thor', '~> 0.19' | ||
spec.add_dependency 'typhoeus' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//= require_tree . | ||
//= require jquery | ||
//= require browse_everything |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,28 @@ def inject_css | |
end | ||
|
||
def inject_javascript | ||
insert_into_file 'app/assets/javascripts/application.js', after: '//= require_tree .' do | ||
%( | ||
//= require jquery | ||
//= require browse_everything | ||
) | ||
if Rails.version =~ /^6\./ | ||
copy_file 'app/assets/javascripts/application.js', 'app/assets/javascripts/application.js' | ||
|
||
# Does this means that Webpacker becomes a hard-dependency? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, this has nothing to do with webpacker. In fact, it's the opposite -- what this line of code is doing is making sure that Sprockets will still handle Javascript, even if you are using Sprockets 4. Since:
So what you're doing is making it so Sprockets will still do JS in Rails 6.0.1 with Sprockets 4 -- nothing to do with webpacker at all. So at least, you probably want to remove/change this comment. But also, since this is a generator -- you probably want to document where (README?) that the browse-everything installer under Rails 6 is going to re-enable Sprockets handling of JS, and add a line to your application.html.erb layout that generates a <script> tag for a sprockets-compiled application.js in addition to the existing webpacker-compiled one. Which is not ideal -- but is better than browse-everything not working at all, it's what we've got for Rails 6 right now. |
||
insert_into_file 'app/assets/config/manifest.js', after: '//= link_directory ../stylesheets .css' do | ||
%( | ||
//= link_directory ../javascripts .js | ||
) | ||
end | ||
|
||
insert_into_file 'app/views/layouts/application.html.erb', after: "<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>" do | ||
%( | ||
<%= javascript_include_tag 'application' %> | ||
) | ||
end | ||
else | ||
insert_into_file 'app/assets/javascripts/application.js', after: '//= require_tree .' do | ||
%( | ||
//= require jquery | ||
//= require browse_everything | ||
) | ||
end | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here, but I cannot disable
engine_cart
from insertingwebpacker
as a dependency.