How can I return some value from a task Rakein ruby.
Code example:
namespace tasks
task task1: :environment do |task|
log = "Running task"
puts log
log << "Done"
return log # suggest how to do this
end
end
I would do a rake as: Rake::Task['tasks:task1'].invoke. How to get the return value in a variable as follows:
result = Rake::Task['tasks:task1'].invoke
source
share