Skip to content

Commit

Permalink
Dont use RUBY_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Aug 14, 2011
1 parent 209994a commit 30cbc05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/cramp.rb
Expand Up @@ -15,8 +15,11 @@

require 'rack'

if RUBY_VERSION >= '1.9.1'
begin
require 'fiber'
require File.join(File.dirname(__FILE__), 'vendor/fiber_pool')
rescue LoadError
# No fibers available!
end

module Cramp
Expand Down
4 changes: 2 additions & 2 deletions lib/cramp/fiber_pool.rb
Expand Up @@ -8,8 +8,8 @@ module FiberPool

module ClassMethods
def use_fiber_pool(options = {})
if RUBY_VERSION < '1.9.1'
raise "Fibers are supported only for Rubies >= 1.9.1"
unless defined?(::FiberPool)
raise "Fiber support is only available for Rubies >= 1.9.2"
end

self.fiber_pool = ::FiberPool.new(options[:size] || 100)
Expand Down

0 comments on commit 30cbc05

Please sign in to comment.