Sha256: 96629eeadb78b0f1393e9f8689df6f4580058f3bfb502cf8eb4de4a1d7070bc7
Contents?: true
Size: 727 Bytes
Versions: 31
Compression:
Stored size: 727 Bytes
Contents
require 'rack/app' 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
31 entries across 31 versions & 1 rubygems