Created
July 13, 2016 19:26
-
-
Save hferentschik/cc7e240e456b38007e3d28f7633438fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :test, [:provider] => [:download_provider] do |t,args| | |
puts "Now running test against provider '#{args[:provider]}'" | |
end | |
class DownloadTask < Rake::Task | |
def needed? | |
puts "\n#{self.class}.#{__callee__} - Don't know which file to check, " \ | |
"since I don't know which argument was passed to test task.\n\n" | |
true | |
end | |
end | |
def download(*args, &block) | |
DownloadTask.define_task(*args, &block) | |
end | |
download 'download_provider', [:provider] do |t, args| | |
puts "Now I know that the requested provider is '#{args[:provider]}'" | |
puts "Downloading required image for provider '#{args[:provider]}'\n\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment