qoobaa / s3

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

warning on ruby 2.4.0 #123

Open arthurnn opened 7 years ago

arthurnn commented 7 years ago

getting the following warning on ruby 2.4.0

/Users/arthurnn/.gem/ruby/2.4.0/gems/s3-0.3.25/lib/s3/bucket.rb:209:in `bucket_request': S3::Bucket#service_request at /Users/arthurnn/.rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:156 forwarding to private method S3::Service#service_request

that is happening at the service.buckets.find method

joseairosa commented 7 years ago

S3::Object#bucket_request is delegating to S3::Bucket#bucket_request which is a private method. This was identified as an unwanted "fixed" bug... as you should not be able to delegate to private methods, but it was decided to throw a warning instead. I believe this will be removed at some point. I'll try to open a PR with a fix for this asap.

arthurnn commented 7 years ago

thanks @joseairosa

krunalsha commented 7 years ago

Getting same warning

joseairosa commented 7 years ago

Still didn't have time to do this, apologies :(

stevebissett commented 6 years ago

This issue is still present?

Is the aim to remove the warning? Or stop delegation to the private method? Would like to help how I can to close this out this week if possible @joseairosa

joseairosa commented 6 years ago

@stevebissett definitely still needs to be fixed, I just haven't been able to get around it and do it.

I'll try to do it this upcoming weekend.

qoobaa commented 6 years ago

I've just released 0.3.26 - let me know if something is still broken.

stuartrr commented 6 years ago

0.3.26 broke something for us. I didn't investigate and just pinned Gemfile to 0.3.25. I'll try to take a look at what it was next week.

The symptom was that object.content was always 27 bytes compressed when sent over the wire using code like this:

send_data object.content, filename: "somename.jpeg", type: "application/octet-stream"

ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux-gnu] rails 3.2.22

maknz commented 5 years ago

Forwardable is used in S3::Object too, which is causing similar issues on newer Ruby. The S3::Bucket fix worked nicely, however.