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

Version Path
rack-app-6.3.2 lib/rack/app/cli.rb
rack-app-6.3.1 lib/rack/app/cli.rb
rack-app-6.3.0 lib/rack/app/cli.rb
rack-app-6.2.0 lib/rack/app/cli.rb
rack-app-6.1.0 lib/rack/app/cli.rb
rack-app-6.0.0 lib/rack/app/cli.rb
rack-app-5.12.0 lib/rack/app/cli.rb
rack-app-5.11.1 lib/rack/app/cli.rb
rack-app-5.11.0 lib/rack/app/cli.rb
rack-app-5.10.2 lib/rack/app/cli.rb
rack-app-5.10.1 lib/rack/app/cli.rb
rack-app-5.10.0 lib/rack/app/cli.rb
rack-app-5.9.0 lib/rack/app/cli.rb
rack-app-5.8.0 lib/rack/app/cli.rb
rack-app-5.7.0 lib/rack/app/cli.rb
rack-app-5.7.0.rc lib/rack/app/cli.rb
rack-app-5.6.0 lib/rack/app/cli.rb
rack-app-5.5.1 lib/rack/app/cli.rb
rack-app-5.4.0 lib/rack/app/cli.rb
rack-app-5.3.2 lib/rack/app/cli.rb