rake icon indicating copy to clipboard operation
rake copied to clipboard

Fix the issues #173 and #192 with the 'Rake::Task#results'

Open karreiro opened this issue 3 years ago • 1 comments

This PR fixes issues #173 and #192 by introducing the Rake::Task#results method.

We could also have the RakeTask#status or RakeTask#exit_status methods (and maybe keep #results private).

However, we would need to inspect the result of each task execution and adopt a convention for statuses. Thus, exposing #results seems a bit more flexible and permits this kind of use case:

task default: %w[test]

task :test do
  puts 'Testing...'
  :success
end
require "rake"

Rake.application.load_rakefile

task = Rake::Task[:test]

task.invoke

p task.results
# => [:success]

karreiro avatar May 08 '22 17:05 karreiro

(I just rebased the branch to solve conflicts)

karreiro avatar May 10 '22 12:05 karreiro