From 0564571baef10d2b9cbeb201722552500f2a5adb Mon Sep 17 00:00:00 2001 From: Nitay Joffe Date: Thu, 31 Jul 2014 02:19:53 -0400 Subject: [PATCH] prevent stringio error from opening small files --- lib/tasks/docs.thor | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index 287b178a..cca8dfca 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -1,3 +1,8 @@ +# Prevents this error: https://gist.github.com/nitay/0cbf5ccb2bc611f627e5 +# See also: http://stackoverflow.com/questions/694115/why-does-ruby-open-uris-open-return-a-stringio-in-my-unit-test-but-a-fileio-in +OpenURI::Buffer.send :remove_const, 'StringMax' if OpenURI::Buffer.const_defined?('StringMax') +OpenURI::Buffer.const_set 'StringMax', 0 + class DocsCLI < Thor include Thor::Actions