Class: Rake::Pipeline::RejectMatcher
- Inherits:
-
Matcher
- Object
- Rake::Pipeline
- Matcher
- Rake::Pipeline::RejectMatcher
- Defined in:
- lib/rake-pipeline/reject_matcher.rb
Overview
A RejectMatcher is a pipeline that does no processing. It simply filters out some files. You can use this when you have more complex logic that doesn’t fit nicely in a glob.
You can pass a block or a glob (just like DSL#match). Files matching the glob will be rejected from the pipeline. Files are rejected when the block evaluates to true. Specify either a glob or a block.
In general, you should not use RejectMatcher directly. Instead use DSL#reject in the block passed to build.
Constant Summary
Constants inherited from Rake::Pipeline
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Attributes inherited from Matcher
Attributes inherited from Rake::Pipeline
#filters, #input_files, #inputs, #output_root, #project, #rake_tasks, #tmpdir
Instance Method Summary collapse
Methods inherited from Matcher
Methods inherited from Rake::Pipeline
#add_filters, #add_input, build, #build, #copy, #finalize, #fingerprint, #initialize, #invoke, #last_manifest, #manifest, #rake_application, #rake_application=, #setup, #setup_filters
Constructor Details
This class inherits a constructor from Rake::Pipeline
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
16 17 18 |
# File 'lib/rake-pipeline/reject_matcher.rb', line 16 def block @block end |
Instance Method Details
#output_files ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/rake-pipeline/reject_matcher.rb', line 18 def output_files input_files.reject do |file| if block block.call file else file.path =~ @pattern end end end |