Class: Ironment::Executor
- Inherits:
-
Object
- Object
- Ironment::Executor
- Defined in:
- lib/ironment/executor.rb
Instance Method Summary collapse
- #exec(command, *args) ⇒ Object
-
#initialize(options = {}) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(options = {}) ⇒ Executor
Returns a new instance of Executor.
5 6 7 |
# File 'lib/ironment/executor.rb', line 5 def initialize( = {}) @exec = [: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 |