Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove postprocessors and keep right order

  • Loading branch information...
commit 2979f05cb1700091736e8a485856cc3c56f1efe3 1 parent cb58096
@RavWar RavWar authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/sprockets/unprocessed_asset.rb
View
7 lib/sprockets/unprocessed_asset.rb
@@ -6,10 +6,11 @@ def initialize(environment, logical_path, pathname)
@environment = environment
context = environment.context_class.new(environment, logical_path, pathname)
attributes = environment.attributes_for(pathname)
+ preprocessors = environment.preprocessors(content_type)
- # Remove all engine processors except ERB to return unprocessed source file
+ # Remove all postprocessors and engines except ERB to return unprocessed source file
allowed_engines = [Tilt::ERBTemplate]
- processors = attributes.processors - (attributes.engines - allowed_engines)
+ processors = preprocessors + (allowed_engines & attributes.engines)
@source = context.evaluate(pathname, :processors => processors)
@@ -20,7 +21,7 @@ def initialize(environment, logical_path, pathname)
allowed_engines << Sass::Rails::ScssTemplate if defined?(Sass::Rails::ScssTemplate)
allowed_engines << Sass::Rails::SassTemplate if defined?(Sass::Rails::SassTemplate)
allowed_engines << Less::Rails::LessTemplate if defined?(Less::Rails::LessTemplate)
- processors = attributes.processors - (attributes.engines - allowed_engines)
+ processors = preprocessors + (allowed_engines & attributes.engines)
@source = context.evaluate(pathname, :processors => processors)
end

0 comments on commit 2979f05

Please sign in to comment.
Something went wrong with that request. Please try again.