Class: Ironment::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/ironment/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Executor

Returns a new instance of Executor.



5
6
7
# File 'lib/ironment/executor.rb', line 5

def initialize(options = {})
  @exec = options[:exec] || Exec.new
end

Instance Method Details

#exec(command, *args) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/ironment/executor.rb', line 9

def exec(command, *args)
  @exec.exec command, *args
rescue Errno::EACCES
  raise AccessDenied, command
rescue Errno::ENOENT
  raise NoEntity, command
rescue Errno::EISDIR
  raise IsDirectory, command
end