Sha256: d09a37b7155e3a8faf08dc2a98a2c9ccded55b312d00f38f4596eea5647dcbf9

Contents?: true

Size: 1.08 KB

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
smallcage-0.3.2 lib/smallcage/runner.rb
smallcage-0.3.1 lib/smallcage/runner.rb
smallcage-0.3.0 lib/smallcage/runner.rb
smallcage-0.2.9 lib/smallcage/runner.rb
smallcage-0.2.8 lib/smallcage/runner.rb
smallcage-0.2.7 lib/smallcage/runner.rb