Skip to content

Commit

Permalink
Update load logic to support REE (which defines RUBY_ENGINE)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed May 5, 2009
1 parent d5ae15d commit 4b9f97f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/memcache.rb
Expand Up @@ -11,12 +11,12 @@
# http://ph7spot.com/articles/system_timer
# We don't want to bother trying to load SystemTimer on jruby and
# ruby 1.9+.
if !defined?(RUBY_ENGINE)
require 'system_timer'
MemCacheTimer = SystemTimer
else
if defined?(JRUBY_VERSION) || (RUBY_VERSION >= '1.9')
require 'timeout'
MemCacheTimer = Timeout
else
require 'system_timer'
MemCacheTimer = SystemTimer
end
rescue LoadError => e
puts "[memcache-client] Could not load SystemTimer gem, falling back to Ruby's slower/unsafe timeout library: #{e.message}"
Expand Down

3 comments on commit 4b9f97f

@kineticac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet, thank you! I'll try it out now on my REE

@kineticac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the version of memcache-client need to be bumped for the gem update command to pick it up?

@mperham
Copy link
Owner Author

@mperham mperham commented on 4b9f97f May 6, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have not released this change yet as I have not checked it myself aside from IRB.

Please sign in to comment.