module AmoebaDeployTools::Concerns::Hooks

Public Class Methods

included(base) click to toggle source
# File lib/amoeba_deploy_tools/commands/concerns/hooks.rb, line 4
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

invoke_command(command, *args) click to toggle source

Instance methods

Calls superclass method
# File lib/amoeba_deploy_tools/commands/concerns/hooks.rb, line 31
def invoke_command(command, *args)
  # Ignore hooks on help commands
  if command.name == 'help'
    return super
  end

  self.class.before_hooks.each {|h| instance_eval &h }
  retVal = super
  self.class.after_hooks.each {|h| instance_eval &h }
  return retVal
end