Permalink
Browse files

Don't raise error for legit tmp files

This commit fixes an error when chaining multiple filters. Filters will
correctly put files inside the tmp directory. This commit verifies that
all files are not inside the tmp directory when input_files is
calculated. This will raise an error when you match files inside the
pipeline's tmp dir or specifically add it as an input
  • Loading branch information...
1 parent ea7a33d commit 8fdb9644553ec04af5066350edaebf8910fa9a0e twinturbo committed Oct 26, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 lib/rake-pipeline.rb
View
@@ -271,7 +271,11 @@ def input_files
files.each do |file|
relative_path = file.sub(%r{^#{Regexp.escape(expanded_root)}/}, '')
- result << FileWrapper.new(expanded_root, relative_path)
+ wrapped_file = FileWrapper.new(expanded_root, relative_path)
+
+ raise TmpInputError, file if wrapped_file.in_directory?(tmpdir)
+
+ result << wrapped_file
end
end
@@ -344,12 +348,6 @@ def setup
# @return [void]
# @api private
def setup_filters
- # First verify that everything can actually be an input
- # FIXME: define eligible_input_files to filter out tmpfile
- eligible_input_files.each do |file|
- raise TmpInputError, file.fullpath if file.in_directory? tmpdir
- end
-
last = @filters.last
@filters.inject(eligible_input_files) do |current_inputs, filter|

0 comments on commit 8fdb964

Please sign in to comment.