Class: Rake::Pipeline::ConcatFilter
- Defined in:
- lib/rake-pipeline/filters/concat_filter.rb
Overview
A built-in filter that simply accepts a series of inputs and concatenates them into output files based on the output file name generator.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Filter
#file_wrapper_class, #input_files, #output_name_generator, #output_root, #pipeline, #rake_application, #rake_tasks
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
A new instance of ConcatFilter.
Methods inherited from Filter
#additional_dependencies, #generate_rake_tasks, #output_files, #outputs, processes_binary_files
Constructor Details
#initialize(string = nil, &block) ⇒ ConcatFilter
Returns a new instance of ConcatFilter.
35 36 37 38 |
# File 'lib/rake-pipeline/filters/concat_filter.rb', line 35 def initialize(string=nil, &block) block = proc { string } if string super(&block) end |
Instance Method Details
#encoding ⇒ String
Returns the String “BINARY”.
42 |
# File 'lib/rake-pipeline/filters/concat_filter.rb', line 42 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.
56 57 58 59 60 |
# File 'lib/rake-pipeline/filters/concat_filter.rb', line 56 def generate_output(inputs, output) inputs.each do |input| output.write input.read end end |