lib/sassc/rails/railtie.rb in sassc-rails-1.2.1 vs lib/sassc/rails/railtie.rb in sassc-rails-1.3.0
- old
+ new
@@ -48,11 +48,23 @@
env.context_class.class_eval do
class_attribute :sass_config
self.sass_config = app.config.sass
end
- env.register_engine '.sass', SassC::Rails::SassTemplate
- env.register_engine '.scss', SassC::Rails::ScssTemplate
+ if env.respond_to?(:register_transformer)
+ env.register_transformer 'text/sass', 'text/css', SassC::Rails::SassTemplate.new #->() { puts "yoyoyoy" }
+ env.register_transformer 'text/scss', 'text/css', SassC::Rails::ScssTemplate.new #->() { puts "yoyoyoy" }
+ end
+
+ if env.respond_to?(:register_engine)
+ [
+ ['.sass', SassC::Rails::SassTemplate],
+ ['.scss', SassC::Rails::ScssTemplate]
+ ].each do |engine|
+ engine << { silence_deprecation: true } if Sprockets::VERSION.start_with?("3")
+ env.register_engine(*engine)
+ end
+ end
end
end
initializer :setup_compression, group: :all do |app|
if !Rails.env.development?