Skip to content

Commit

Permalink
Merge pull request #76 from RavWar/postprocessor_fix
Browse files Browse the repository at this point in the history
Remove postprocessors and keep right order
  • Loading branch information
ndbroadbent committed Sep 23, 2013
2 parents cb58096 + 2979f05 commit 6202a38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/sprockets/unprocessed_asset.rb
Expand Up @@ -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)

Expand All @@ -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

Expand Down

0 comments on commit 6202a38

Please sign in to comment.