Sha256: bebbf08a9d846e071b6e766e381995119108689e897450547c29495abe8a4994
Contents?: true
Size: 704 Bytes
Versions: 49
Compression:
Stored size: 704 Bytes
Contents
class Rack::App::CLI::Command require 'optparse' require 'rack/app/cli/command/configurator' class << self def option_definitions @options_parser_options ||= [] end def description(message = nil) @description = message unless message.nil? @description || '' end alias desc description def option(*args, &block) option_definitions << {:args => args, :block => block} end alias on option def action(&block) define_method(:action, &block) end end def options @options ||= {} end def action(*argv) end def start(argv) action(*argv) rescue ArgumentError => ex $stderr.puts(ex.message) end end
Version data entries
49 entries across 49 versions & 1 rubygems