Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Fixes for Ruby Warnings #62

Merged
merged 4 commits into from
Jan 26, 2017
Merged

⚠️ Fixes for Ruby Warnings #62

merged 4 commits into from
Jan 26, 2017

Conversation

amatsuda
Copy link
Contributor

Here are fixes for some Ruby warnings with the 2.0.1 gem.

Copy link
Member

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client.rb is generated (it says so at the top), so please edit https://github.com/ruby-amqp/amq-protocol/blob/master/codegen/protocol.rb.pytemplate instead.

@michaelklishin michaelklishin self-assigned this Jan 25, 2017
@michaelklishin
Copy link
Member

Thank you for looking into this!

@amatsuda
Copy link
Contributor Author

Ugh, why did I miss the comment at the top of the file I was editing...
I guess I'm done!

@michaelklishin
Copy link
Member

Now client.rb needs regenerating. I'm happy to do it myself, can you please change your branch name to something easier to work with in the shell?

@amatsuda
Copy link
Contributor Author

I did run ./generate.rb and included the related change for client.rb in the relevant commit.

Besides that, I see a chunk of diff like this in the generated code:

diff --git a/lib/amq/protocol/client.rb b/lib/amq/protocol/client.rb
index 85dafb7..60a1c51 100644
--- a/lib/amq/protocol/client.rb
+++ b/lib/amq/protocol/client.rb
@@ -1437,8 +1437,7 @@ module AMQ
         result = [60, 0].pack(PACK_UINT16_X2)
         result += AMQ::Pack.pack_uint64_big_endian(body_size)
         result += [flags].pack(PACK_UINT16)
-        pieces_joined = pieces.join(EMPTY_STRING)
-        result.force_encoding(pieces_joined.encoding) + pieces_joined
+        result + pieces.join(EMPTY_STRING)
       end
 
       # THIS DECODES ONLY FLAGS

I didn't include that in this PR because this reproduces when I run the generator in master, so I'm sure this is unrelated to my changes here.

@michaelklishin
Copy link
Member

OK, I will take a look. Thank you.

@michaelklishin michaelklishin merged commit e4229b5 into ruby-amqp:master Jan 26, 2017
@michaelklishin
Copy link
Member

@amatsuda thank you. Indeed the fix in #56 wasn't properly applied to the pytemplate file.

A minor comment on the branch name if I may. It's certainly witty to use a single warning sign emoji in a branch that fixes warnings but it was a bit frustrating to work with in the terminal.

I will release a 2.1.0 later today or tomorrow. Thanks again.

@amatsuda
Copy link
Contributor Author

@michaelklishin Thank you! And I'm so sorry about the branch name...

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Mar 20, 2017
## Changes between 2.0.0 and 2.1.0

### Ruby Warnings Squashed

Contributed by Akira Matsuda.

GitHub issue: [#62](ruby-amqp/amq-protocol#62)

### Byte Array Decoding

Byte array values in types now can be
decoded (to the extent Ruby type system
permits) by this library.

GitHub issue: [#58](ruby-amqp/amq-protocol#58)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants