myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3172] branches/wf4ever/config/initializers/strin


From: noreply
Subject: [myexperiment-hackers] [3172] branches/wf4ever/config/initializers/stringio_patch.rb: added patch for readpartial support in ruby 1.8.7
Date: Wed, 24 Oct 2012 14:01:25 +0000 (UTC)

Revision
3172
Author
dgc
Date
2012-10-24 14:01:25 +0000 (Wed, 24 Oct 2012)

Log Message

added patch for readpartial support in ruby 1.8.7

Added Paths

Diff

Added: branches/wf4ever/config/initializers/stringio_patch.rb (0 => 3172)


--- branches/wf4ever/config/initializers/stringio_patch.rb	                        (rev 0)
+++ branches/wf4ever/config/initializers/stringio_patch.rb	2012-10-24 14:01:25 UTC (rev 3172)
@@ -0,0 +1,18 @@
+# myExperiment: config/initializers/stringio_patch.rb
+#
+# Copyright (c) 2012 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+if VERSION == "1.8.7"
+  class StringIO
+    def readpartial(*args)
+      result = read(*args)
+      if result.nil?
+        raise EOFError
+      else
+        result
+      end
+    end
+  end
+end
+

reply via email to

[Prev in Thread] Current Thread [Next in Thread]