Why does Ruby open-uri's open return a StringIO in my unit test, but a FileIO in my controller?

前端 未结 3 733
梦谈多话
梦谈多话 2020-12-24 06:43

I inherited a Rails 2.2.2 app that stores user-uploaded images on Amazon S3. The attachment_fu-based Photo model offers a rotate method that uses <

3条回答
  •  余生分开走
    2020-12-24 07:11

    Now OpenURI::Buffer::StringMax can be set directly:

    require 'open-uri'
    OpenURI::Buffer::StringMax = 0
    

    but with a warning:

    warning: already initialized constant OpenURI::Buffer::StringMax
    

提交回复
热议问题