qoobaa / s3

Library for accessing S3 objects and buckets, supports EU and US buckets
MIT License
258 stars 112 forks source link

Version 0.3.26 requires S3::Object#content(true) to fetch object contents #125

Closed lisa closed 6 years ago

lisa commented 6 years ago

It appears that fc4d193 introduced a change that has initialized @content in S3::Object#initialize. By doing this if defined?(@content) returns true, thus returning a nil object.

I made a short test to isolate and verify the issue. Small test and output over various Ruby versions can be located in a gist.

Unfortunately I'm not sure what the intent is behind fc4d193 so I'm not really able to submit a PR for this.

qoobaa commented 6 years ago

I think the main intent was reducing amount of warning messages in Ruby 2.4. Thank you for describing the issue accurately. I'm pretty sure we could replace the defined? with @content ||= and it should work fine as well. Are you able to submit a proper PR to fix it?

lisa commented 6 years ago

@qoobaa Hi, I opened #126 which should address this.