Sha256: b797b9104d7987edd377496d93f828b2dce601f325f916091dfa909ba36f669d

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'thor/group'
require 'artoo/robot'
require 'artoo/commands/generate'
require 'artoo/commands/connect'
require 'artoo/commands/install'

Celluloid.logger = nil

module CLI
  class Root < Thor
    include Thor::Actions
    
    desc 'version', 'Displays the current version'
    def version
      say Artoo::VERSION
    end

    desc "console ROBOT", "Run a robot using the Robi console"
    def console(robot)
      run("robi #{robot}")
    end

    desc "start ROBOT", "Run a robot"
    option :delay, :default => 0, :desc => "Number of seconds to wait for connections"
    def start(robot)
      say "Starting robot..."
      delay = options[:delay].to_i
      sleep(delay) if delay > 0
      run("ruby #{robot}")
    end

    desc "generate SUBCOMMAND ...ARGS", "Generates a new robot or adaptor"
    subcommand "generate", Artoo::Commands::Generate

    desc "connect SUBCOMMAND ...ARGS", "Connects to device"
    subcommand "connect", Artoo::Commands::Connect

    desc "install SUBCOMMAND ...ARGS", "Installs utility programs"
    subcommand "install", Artoo::Commands::Install
  end
end

CLI::Root.start

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
artoo-1.0.0 bin/artoo
artoo-1.0.0.rc4 bin/artoo
artoo-1.0.0.rc3 bin/artoo