Sha256: 8e429f330dd2fd11007c79f42a678193af017125fde2af3054fd85721093838c

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

module SmallCage
  class Runner
    def self.run(opts)
      Runner.new(opts).send(opts[:command])
    end

    def initialize(opts)
      @opts = opts
      require_command "base"
    end

    def update
      require_command "update"
      SmallCage::Commands::Update.execute(@opts)
    end

    def clean
      require_command "clean"
      SmallCage::Commands::Clean.execute(@opts)
    end

    def server
      require_command "server"
      SmallCage::Commands::Server.execute(@opts)
    end

    def auto
      require_command "auto"
      SmallCage::Commands::Auto.execute(@opts)
    end

    def import
      require_command "import"
      SmallCage::Commands::Import.execute(@opts)
    end

    def manifest
      require_command "manifest"
      SmallCage::Commands::Manifest.execute(@opts)
    end

    def export
      require_command "export"
      SmallCage::Commands::Export.execute(@opts)
    end

    def uri
      require_command "uri"
      SmallCage::Commands::Uri.execute(@opts)
    end

    def require_command(name)
      require "smallcage/commands/#{name}.rb"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smallcage-0.2.6 lib/smallcage/runner.rb
smallcage-0.2.5 lib/smallcage/runner.rb