Class: Rake::Pipeline::OrderingConcatFilter
- Inherits:
-
ConcatFilter
- Object
- Filter
- ConcatFilter
- Rake::Pipeline::OrderingConcatFilter
- Defined in:
- lib/rake-pipeline/filters/ordering_concat_filter.rb
Overview
A filter that concats files in a specified order.
Instance Attribute Summary
Attributes inherited from Filter
#file_wrapper_class, #input_files, #last_manifest, #manifest, #output_name_generator, #output_root, #pipeline, #rake_application, #rake_tasks
Instance Method Summary collapse
-
#generate_output(inputs, output) ⇒ Object
Extend the #generate_output method supplied by ConcatFilter.
-
#initialize(ordering, string = nil, &block) ⇒ OrderingConcatFilter
constructor
A new instance of OrderingConcatFilter.
Methods inherited from ConcatFilter
Methods inherited from Filter
#additional_dependencies, #generate_rake_tasks, #output_files, #outputs, processes_binary_files
Constructor Details
#initialize(ordering, string = nil, &block) ⇒ OrderingConcatFilter
Returns a new instance of OrderingConcatFilter.
22 23 24 25 |
# File 'lib/rake-pipeline/filters/ordering_concat_filter.rb', line 22 def initialize(ordering, string=nil, &block) @ordering = ordering super(string, &block) end |
Instance Method Details
#generate_output(inputs, output) ⇒ Object
Extend the #generate_output method supplied by ConcatFilter. Re-orders the inputs such that the specified files come first. If a file is not in the list it will come after the specified files.
30 31 32 33 34 35 36 |
# File 'lib/rake-pipeline/filters/ordering_concat_filter.rb', line 30 def generate_output(inputs, output) @ordering.reverse.each do |name| file = inputs.find{|i| i.path == name } inputs.unshift(inputs.delete(file)) if file end super end |