Class: Machines::LogCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/machines/log_command.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#check, #command

Instance Method Summary collapse

Methods inherited from Command

scp, scp=, ssh, ssh=, #use_sudo

Constructor Details

#initialize(name, description) ⇒ LogCommand

Returns a new instance of LogCommand.



5
6
7
8
# File 'lib/machines/log_command.rb', line 5

def initialize name, description
  @name = name
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/machines/log_command.rb', line 3

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/machines/log_command.rb', line 3

def name
  @name
end

Instance Method Details

#infoObject



17
18
19
# File 'lib/machines/log_command.rb', line 17

def info
  "TASK   #{@name} - #{@description}"
end

#runObject



10
11
12
13
14
15
# File 'lib/machines/log_command.rb', line 10

def run
  Command.console.log ''
  Command.console.log '     ' + info, :color => :info, :progress => progress
  Command.file.log ''
  Command.file.log info, :color => :info
end