about summary refs log tree commit homepage
path: root/lib/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-05 02:34:35 +0000
committerEric Wong <normalperson@yhbt.net>2011-11-05 02:34:35 +0000
commit283050fc283868f79796f05901bd9149713ae282 (patch)
tree60b5f97790421689e2e84f709f7a22d61c7ff9da /lib/mogilefs.rb
parentf057a82730d252c509f8c590430dbf4507d17601 (diff)
downloadmogilefs-client-283050fc283868f79796f05901bd9149713ae282.tar.gz
Avoid deepening stack depth and make it easier to migrate
fully to 1.9 in the future (dropping 1.8 support).
Diffstat (limited to 'lib/mogilefs.rb')
-rw-r--r--lib/mogilefs.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/mogilefs.rb b/lib/mogilefs.rb
index c4ea147..d0f3e21 100644
--- a/lib/mogilefs.rb
+++ b/lib/mogilefs.rb
@@ -27,6 +27,13 @@ module MogileFS
     def message; "couldn't connect to mogilefsd backend"; end
   end
 
+  # IO.copy_stream was buggy in Ruby 1.9.2 and earlier
+  if RUBY_VERSION >= "1.9.3"
+    X = IO
+  else
+    require "mogilefs/copy_stream"
+    X = MogileFS::CopyStream
+  end
 end
 
 require 'mogilefs/backend'