Skip to content

Instantly share code, notes, and snippets.

@colin
Forked from richievos/skippable_task.rb
Created March 31, 2010 15:51
Show Gist options
  • Save colin/350491 to your computer and use it in GitHub Desktop.
Save colin/350491 to your computer and use it in GitHub Desktop.
module Capistrano
class Configuration
module Namespaces
def skippable_task(name, *args, &block)
task name, *args do
if find_servers_for_task(current_task).empty?
logger.info "skipping #{current_task.fully_qualified_name} since it matches no servers"
else
block.call
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment