Module: RackPipeline::Processing

Included in:
Base
Defined in:
lib/rack-pipeline/processing.rb

Instance Method Summary collapse

Instance Method Details

#combine(sources, target) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/rack-pipeline/processing.rb', line 5

def combine(sources, target)
  cache_target(sources, target) do |target_path|
    body = sources.inject('') do |all,(source,kind)|
      all << "/*!\n * #{source}\n */\n\n" + File.read(prepare_file(source, static_type(target))).encode('utf-8') + "\n\n"
    end
    File.write(target_path, body)
    target_path
  end
end

#compile(source, target) ⇒ Object



22
23
24
25
26
# File 'lib/rack-pipeline/processing.rb', line 22

def compile(source, target)
  cache_target(source, target) do |target_path|
    Compiling.process(source, target_path)
  end
end

#compress(source, target) ⇒ Object



15
16
17
18
19
20
# File 'lib/rack-pipeline/processing.rb', line 15

def compress(source, target)
  return source unless settings[:compress]
  cache_target(source, target) do |target_path|
    Compressing.process(source, target_path)
  end
end