Class: Madeleine::Executer

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(system) ⇒ Executer

Returns a new instance of Executer.



182
183
184
185
# File 'lib/madeleine.rb', line 182

def initialize(system)
  @system = system
  @in_recovery = false
end

Instance Method Details

#execute(command) ⇒ Object



187
188
189
190
191
192
193
# File 'lib/madeleine.rb', line 187

def execute(command)
  begin
    command.execute(@system)
  rescue
    raise unless @in_recovery
  end
end

#recoveryObject



195
196
197
198
199
200
201
202
# File 'lib/madeleine.rb', line 195

def recovery
  begin
    @in_recovery = true
    yield
  ensure
    @in_recovery = false
  end
end