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.19.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.18.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.17.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.16.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.15.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.14.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.13.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.12.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.11.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.10.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.8.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.7.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.6.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.5.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.4.1 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.4.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.3.1 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.3.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.2.0 spec/lib/abstractivator/schedule/em_util.rb
abstractivator-0.1.1 spec/lib/abstractivator/schedule/em_util.rb