module Albacore::CliDSL::InstanceMethods

Public Instance Methods

run_command(command) click to toggle source

Calls an instance method defined via the ::command class method. Raises CommandError if the command does not exist.

# File lib/albacore/cli_dsl.rb, line 15
def run_command(command)
  method_name = "#{self.class.command_prefix}#{command}"
  if self.class.method_defined?(method_name)
    send method_name
  else
    raise CommandError, "invalid command #{command}"
  end
end