Class: Extruder::ConcatFilter
- Defined in:
- lib/extruder/filters/concat_filter.rb
Overview
A built-in filter that simply accepts a series of inputs and concatenates them into output files with the output file generator.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Filter
#files, #output_name_generator, #output_root
Instance Method Summary collapse
-
#encoding ⇒ String
The String “BINARY”.
-
#generate_output(inputs, output) ⇒ Object
implement the #generate_output method required by the Filter API.
-
#initialize(string = nil, &block) ⇒ ConcatFilter
constructor
…
Methods inherited from Filter
#outputs, #process, processes_binary_files
Constructor Details
#initialize(string = nil, &block) ⇒ ConcatFilter
… more soon
42 43 44 45 |
# File 'lib/extruder/filters/concat_filter.rb', line 42 def initialize(string=nil, &block) block = proc { string } if string super(&block) end |
Instance Method Details
#encoding ⇒ String
Returns the String “BINARY”.
49 |
# File 'lib/extruder/filters/concat_filter.rb', line 49 processes_binary_files |
#generate_output(inputs, output) ⇒ Object
implement the #generate_output method required by the Filter API. In this case, simply loop through the inputs and write their contents to the output.
Recall that this method will be called once for each unique output file.
66 67 68 69 70 |
# File 'lib/extruder/filters/concat_filter.rb', line 66 def generate_output(inputs, output) inputs.each do |input| output.write input.read end end |