Class: Awt::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/awt/cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



12
13
14
# File 'lib/awt/cli.rb', line 12

def initialize
  parse_opt
end

Instance Attribute Details

#executableObject (readonly)

Returns the value of attribute executable.



10
11
12
# File 'lib/awt/cli.rb', line 10

def executable
  @executable
end

Class Method Details

.startObject



24
25
26
27
28
29
30
31
# File 'lib/awt/cli.rb', line 24

def start
  begin
    cli = self.new
    cli.execute
  rescue => e
    puts e
  end
end

Instance Method Details

#executeObject



16
17
18
19
20
21
# File 'lib/awt/cli.rb', line 16

def execute
  register_targets(@hosts)
  raise "Awtfile not found." if @task_file.nil?
  load @task_file
  $AWT_TASKS[@task_name].exec($AWT_TARGETS)
end