Skip to content

Commit

Permalink
Revert "Merge pull request ruby#183 from aycabta/file-dryrun-bug-92"
Browse files Browse the repository at this point in the history
This reverts commit 5ba97af, reversing
changes made to bc5765f.

Fixes ruby#246
  • Loading branch information
grzuy committed Feb 7, 2018
1 parent 109dd0e commit efe3f02
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 46 deletions.
9 changes: 1 addition & 8 deletions lib/rake/file_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ def timestamp

# Are there any prerequisites with a later time than the given time stamp?
def out_of_date?(stamp)
all_prerequisite_tasks.any? { |prereq|
prereq_task = application[prereq, @scope]
if prereq_task.instance_of?(Rake::FileTask)
prereq_task.timestamp > stamp || @application.options.build_all
else
prereq_task.timestamp > stamp
end
}
@prerequisites.any? { |n| application[n, @scope].timestamp > stamp }
end

# ----------------------------------------------------------------
Expand Down
18 changes: 0 additions & 18 deletions test/support/rakefile_definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,6 @@ def rakefile_chains
DEFAULT
end

def rakefile_file_chains
rakefile <<-RAKEFILE
file "fileA" do |t|
sh "echo contentA >\#{t.name}"
end
file "fileB" => "fileA" do |t|
sh "(cat fileA; echo transformationB) >\#{t.name}"
end
file "fileC" => "fileB" do |t|
sh "(cat fileB; echo transformationC) >\#{t.name}"
end
task default: "fileC"
RAKEFILE
end

def rakefile_comments
rakefile <<-COMMENTS
# comment for t1
Expand Down
20 changes: 0 additions & 20 deletions test/test_rake_functional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,26 +296,6 @@ def test_rules_chaining_to_file_task
"'play.app' file should exist"
end

def dryrun_tasks
@err.split("\n").select { |line|
line.match(/^\*\* Execute/)
}.map { |line|
line.gsub(/^\*\* Execute \(dry run\) /, "")
}
end

def test_update_midway_through_chaining_to_file_task
rakefile_file_chains

rake "-n"
assert_equal(%w{fileA fileB fileC default}, dryrun_tasks)
rake
sleep 1 # Ensure the timestamp is on a new second
FileUtils.touch("fileA")
rake "-n"
assert_equal(%w{fileB fileC default}, dryrun_tasks)
end

def test_file_creation_task
rakefile_file_creation

Expand Down

0 comments on commit efe3f02

Please sign in to comment.