Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add Rake::Pipeline::PipelineFinalizingFilter
Change the filter we add to the end of every pipeline from a ConcatFilter (which copies all inputs) to a PipelineFinalizingFilter, which only copies the files that the pipeline created.
- Loading branch information
Showing
5 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
require "rake-pipeline/filters/concat_filter" | ||
require "rake-pipeline/filters/ordering_concat_filter" | ||
require "rake-pipeline/filters/pipeline_finalizing_filter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Rake | ||
class Pipeline | ||
# @private | ||
# | ||
# A built-in filter that copies a pipeline's generated files over | ||
# to its output. | ||
class PipelineFinalizingFilter < ConcatFilter | ||
|
||
# @return [Array[FileWrapper]] a list of the pipeline's | ||
# output files, excluding any files that were originally | ||
# inputs to the pipeline, meaning they weren't processed | ||
# by any filter and should not be copied to the output. | ||
def input_files | ||
super.reject { |file| pipeline.input_files.include?(file) } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters