class Ghundle::Main

Public Class Methods

exec(*args) click to toggle source
# File lib/ghundle/main.rb, line 5
def self.exec(*args)
  new(*args).exec
end
new(*args) click to toggle source
# File lib/ghundle/main.rb, line 9
def initialize(*args)
  @command = args.shift
  @args    = args
end

Public Instance Methods

exec() click to toggle source
# File lib/ghundle/main.rb, line 14
def exec
  case @command
  when 'fetch'          then Command::Fetch.call(*@args)
  when 'install'        then Command::Install.call(*@args)
  when 'list-all'       then Command::ListAll.call(*@args)
  when 'list-installed' then Command::ListInstalled.call(*@args)
  when 'run'            then Command::Run.call(*@args)
  when 'uninstall'      then Command::Uninstall.call(*@args)
  else
    raise AppError.new("Unknown command: #{@command}")
  end
end