Class: Rake::Pipeline::Matcher
- Inherits:
-
Rake::Pipeline
- Object
- Rake::Pipeline
- Rake::Pipeline::Matcher
- Defined in:
- lib/rake-pipeline/matcher.rb
Overview
A Matcher is a type of pipeline that restricts its filters to a particular pattern.
A Matcher’s pattern is a File glob.
For instance, to restrict filters to operating on JavaScript files in the app
directory, the Matcher’s inputs should include “app”, and its glob would be “*.js”.
In general, you should not use Matcher directly. Instead use DSL#match in the block passed to build.
Constant Summary
Constants inherited from Rake::Pipeline
Instance Attribute Summary collapse
-
#glob ⇒ Object
Returns the value of attribute glob.
-
#pipeline ⇒ Rake::Pipeline
The Rake::Pipeline that contains this matcher.
Attributes inherited from Rake::Pipeline
#filters, #input_files, #inputs, #output_root, #project, #rake_tasks, #tmpdir
Instance Method Summary collapse
-
#finalize ⇒ void
private
Override #finalize to do nothing.
-
#output_files ⇒ Array<FileWrapper>
A list of the output files that invoking this pipeline will generate.
Methods inherited from Rake::Pipeline
#add_filters, #add_input, build, #build, #copy, #initialize, #invoke, #invoke_clean, #rake_application, #rake_application=, #setup, #setup_filters
Constructor Details
This class inherits a constructor from Rake::Pipeline
Instance Attribute Details
#glob ⇒ Object
Returns the value of attribute glob.
18 19 20 |
# File 'lib/rake-pipeline/matcher.rb', line 18 def glob @glob end |
#pipeline ⇒ Rake::Pipeline
Returns the Rake::Pipeline that contains this matcher.
22 23 24 |
# File 'lib/rake-pipeline/matcher.rb', line 22 def pipeline @pipeline end |
Instance Method Details
#finalize ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Override Rake::Pipeline#finalize to do nothing. We want to pass on our unmatched inputs to the next part of the pipeline.
57 58 |
# File 'lib/rake-pipeline/matcher.rb', line 57 def finalize end |
#output_files ⇒ Array<FileWrapper>
A list of the output files that invoking this pipeline will generate. This will include the outputs of files matching the glob and any inputs that did not match the glob.
This will make those inputs available to any additional filters or matchers.
46 47 48 49 50 |
# File 'lib/rake-pipeline/matcher.rb', line 46 def output_files super + input_files.reject do |file| file.path =~ @pattern end end |