class Ghundle::Command::Run

Runs the given hook, providing it with the rest of the positional arguments on the command-line.

Public Instance Methods

call() click to toggle source
# File lib/ghundle/command/run.rb, line 10
def call
  name      = args.first
  hook_path = config.hook_path(name)
  hook      = Hook.new(Source::Local.new(hook_path))

  say "Running hook #{hook.name}"

  Signal.trap('INT') do
    say "Ctrl+C caught, aborting"
    exit
  end

  hook.run(*args[1 .. -1])

  Signal.trap('INT', 'DEFAULT')
end