Class: Rake::Pipeline::Matcher

Inherits:
Rake::Pipeline show all
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 input_root should be “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

VERSION

Instance Attribute Summary collapse

Attributes inherited from Rake::Pipeline

#filters, #input_files, #input_glob, #input_root, #output_root, #rake_tasks, #tmpdir

Instance Method Summary collapse

Methods inherited from Rake::Pipeline

#add_filters, build, #copy, #initialize, #invoke, #invoke_clean, #rake_application, #rake_application=, #setup

Constructor Details

This class inherits a constructor from Rake::Pipeline

Instance Attribute Details

#globObject

Returns the value of attribute glob.



18
19
20
# File 'lib/rake-pipeline/matcher.rb', line 18

def glob
  @glob
end

Instance Method Details

#output_filesArray<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.

Returns:



88
89
90
91
92
# File 'lib/rake-pipeline/matcher.rb', line 88

def output_files
  super + input_files.reject do |file|
    file.path =~ @pattern
  end
end