Sha256: 2c9a4ff1e916b33aee476c7918d1ef3a71bf2f6c820e85f01d2892ebea294690

Contents?: true

Size: 318 Bytes

Versions: 21

Compression:

Stored size: 318 Bytes

Contents

require 'eventmachine'

def em
  EM.run do
    EM.add_timer(in_debug_mode? ? 999999 : 3) { raise 'EM spec timed out' }
    yield
  end
end

def in_debug_mode?
  ENV['RUBYLIB'] =~ /ruby-debug-ide/ # http://stackoverflow.com/questions/22039807/determine-if-a-program-is-running-in-debug-mode
end

def done
  EM.stop
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
abstractivator-0.1.0 spec/lib/abstractivator/schedule/em_util.rb