Sha256: ad6237ca5eb2c655924e6c1353e520372d61c8373c7872b56a0346cc39ac88b2
Contents?: true
Size: 708 Bytes
Versions: 36
Compression:
Stored size: 708 Bytes
Contents
require 'optparse' class Rack::App::CLI require 'rack/app/cli/fetcher' require 'rack/app/cli/command' require 'rack/app/cli/default_commands' require 'rack/app/cli/runner' class << self def start(argv) runner.start(argv) end def runner Rack::App::CLI::Runner.new(rack_app) end def rack_app Rack::App::CLI::Fetcher.rack_app end end def merge!(cli) commands.merge!(cli.commands) self end def commands @commands ||= {} end protected def command(name, &block) command_prototype = Class.new(Rack::App::CLI::Command) command_prototype.class_exec(&block) commands[name.to_s.to_sym]= command_prototype.new end end
Version data entries
36 entries across 36 versions & 2 rubygems