Skip to content

Instantly share code, notes, and snippets.

@hferentschik
Created July 13, 2016 19:26
Show Gist options
  • Save hferentschik/cc7e240e456b38007e3d28f7633438fe to your computer and use it in GitHub Desktop.
Save hferentschik/cc7e240e456b38007e3d28f7633438fe to your computer and use it in GitHub Desktop.
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