module Albacore::CliDSL::ClassMethods

Public Instance Methods

command(*command_names, &block) click to toggle source

Defines an instance method based on the first command name. The method executes the code of the given block. Aliases methods for any subsequent command names.

# File lib/albacore/cli_dsl.rb, line 29
def command(*command_names, &block)
  method_name = "#{command_prefix}#{command_names.shift}"
  define_method method_name, &block
  command_names.each do |c|
    alias_method "#{command_prefix}#{c}", method_name
  end
end
command_prefix() click to toggle source

The prefix for any instance method defined by the ::command method.

# File lib/albacore/cli_dsl.rb, line 38
def command_prefix
  :_run_
end