Method: RunLoop::Environment.with_debugging

Defined in:
lib/run_loop/environment.rb

.with_debugging(debug, &block) ⇒ Object

!@visibility private



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/run_loop/environment.rb', line 146

def self.with_debugging(debug, &block)
  if debug
    original_value = ENV['DEBUG']

    begin
      ENV['DEBUG'] = '1'
      block.call
    ensure
      ENV['DEBUG'] = original_value
    end

  else
    block.call
  end
end