Permalink
Browse files

Use RUBY_ENGINE to determine if system_timer is needed.

  • Loading branch information...
1 parent e8ca21f commit 5685065d9a75cc63065496e2404c858e12f2276f Robert Jackson committed Apr 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/faraday.rb
View
@@ -34,10 +34,10 @@ def self.default_connection
end
begin
- require RUBY_VERSION < '1.9' ? 'system_timer' : 'timeout'
+ require defined?(RUBY_ENGINE) ? 'timeout' : 'system_timer'
rescue LoadError
require 'timeout'
- warn "Faraday: you may want to install system_timer for reliable timeouts" unless defined?(JRUBY_VERSION)
+ warn "Faraday: you may want to install system_timer for reliable timeouts"
ensure
Timer = defined?(::SystemTimer) ? ::SystemTimer : ::Timeout
end

0 comments on commit 5685065

Please sign in to comment.