Class: Trestle::SprocketsCompressor

Inherits:
Object
  • Object
show all
Defined in:
lib/trestle/sprockets_compressor.rb

Instance Method Summary collapse

Constructor Details

#initialize(original_compressor, excluded_files: ["trestle/admin"]) ⇒ SprocketsCompressor

Returns a new instance of SprocketsCompressor.



3
4
5
6
# File 'lib/trestle/sprockets_compressor.rb', line 3

def initialize(original_compressor, excluded_files: ["trestle/admin"])
  @original_compressor = original_compressor
  @excluded_files = excluded_files
end

Instance Method Details

#call(input) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/trestle/sprockets_compressor.rb', line 8

def call(input)
  if @excluded_files.include?(input[:name])
    input[:data]
  else
    @original_compressor.call(input)
  end
end