Class: Umarell::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/umarell/command.rb

Overview

The class responsible for running commands

Instance Method Summary collapse

Constructor Details

#initialize(name, arguments = []) ⇒ Command

Returns a new instance of Command.



6
7
8
9
# File 'lib/umarell/command.rb', line 6

def initialize(name, arguments = [])
  @name = name
  @arguments = arguments
end

Instance Method Details

#runObject

Run the command



12
13
14
# File 'lib/umarell/command.rb', line 12

def run
  system "echo '#{header}'; #{self}; echo '#{footer}'"
end

#to_sObject



16
17
18
# File 'lib/umarell/command.rb', line 16

def to_s
  "#{@name} #{@arguments.join(' ')}"
end