Skip to content

Commit

Permalink
Don't raise error for legit tmp files
Browse files Browse the repository at this point in the history
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
twinturbo committed Oct 26, 2012
1 parent ea7a33d commit 8fdb964
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/rake-pipeline.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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|
Expand Down

0 comments on commit 8fdb964

Please sign in to comment.