History

prevent stringio error from opening small files

Nitay Joffe committed 12 years ago

Commit 05645711 parent 2cae43f1 file · +5 −0Browse files

Unified · Split

lib/tasks/docs.thor+5−0
@@ -1,3 +1,8 @@
1# Prevents this error: https://gist.github.com/nitay/0cbf5ccb2bc611f627e5
2# See also: http://stackoverflow.com/questions/694115/why-does-ruby-open-uris-open-return-a-stringio-in-my-unit-test-but-a-fileio-in
3OpenURI::Buffer.send :remove_const, 'StringMax' if OpenURI::Buffer.const_defined?('StringMax')
4OpenURI::Buffer.const_set 'StringMax', 0
5
1class DocsCLI < Thor6class DocsCLI < Thor
2 include Thor::Actions7 include Thor::Actions
3 8