Browse files

Merge pull request #76 from RavWar/postprocessor_fix

Remove postprocessors and keep right order
  • Loading branch information...
2 parents cb58096 + 2979f05 commit 6202a381aaad848ae258310d22aa9b9cefc52be2 @ndbroadbent committed Sep 23, 2013
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 6202a38

Please sign in to comment.