Skip to content
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

support chaining of ERB for Sprockets 4 #191

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

gemspec

gem "rack", "~> 2" # Rack 3 is not compatible with Jasmine and fails -- jasmine-3.99.0/lib/jasmine/server.rb:12:in `start': uninitialized constant Rack::Server (NameError)
ashkulz marked this conversation as resolved.
Show resolved Hide resolved
gem "rails", "~> #{ENV['RAILS_VER'] || raise("missing rails version")}"
gem "sprockets", "~> #{ENV['SPROCKETS_VER'] || raise("missing sprockets version")}"

3 changes: 3 additions & 0 deletions lib/haml_coffee_assets/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class Engine < ::Rails::Engine
env.register_mime_type 'text/hamlc', extensions: ['.hamlc', '.jst.hamlc']
env.register_transformer 'text/hamlc', 'application/javascript', ::HamlCoffeeAssets::Transformer
env.register_transformer 'text/hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer
# support for chaining via ERB, documented via https://github.com/rails/sprockets/pull/807
env.register_mime_type 'text/hamlc+ruby', extensions: ['.hamlc.erb', '.jst.hamlc.erb']
env.register_transformer 'text/hamlc+ruby', 'text/hamlc', ::Sprockets::ERBProcessor
ashkulz marked this conversation as resolved.
Show resolved Hide resolved
end

if env.respond_to?(:register_engine)
Expand Down
Loading