Sha256: 480744254541414fd577b1900f1e5cd519c1c39e586a2d35d2a9ce955ea55eb5

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 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.2.4 lib/smallcage/runner.rb
smallcage-0.2.3 lib/smallcage/runner.rb
smallcage-0.2.2 lib/smallcage/runner.rb
smallcage-0.2.1 lib/smallcage/runner.rb
smallcage-0.2.0 lib/smallcage/runner.rb
smallcage-0.1.9 lib/smallcage/runner.rb