Closed dacto closed 6 years ago
LOTS of pull requests that address the warnings are welcome.
Some warnings ended up being legit mistakes. Others don't make much sense to me. Instance variables that are initialised in Bunny::Session#initialize
, for example, cause a warning in some methods. Perhaps some of those methods are used before the initialisation but some are pretty certainly not invoked in that method, e.g. Bunny::Session#to_s
.
I was just about to submit a PR (still writing detailed commit message) about these! :) I'll pull these latest changes and rebase my changes before submitting the PR.
This was addressed to the extent we easily can do it thanks to #564. There are still some socket extension warnings that would require subclassing Socket
which we don't really have any reasons to do.
The Bunny library emits LOTS of warnings.
Most warnings are from uninitialized variables.
Below is an annotated version of the ""Hello World" example" from http://rubybunny.info/articles/getting_started.html.
More uninitialized variable warnings are emitted while performing other operations that are not included in the example.
hello-rabbit.rb
Running the script with warnings (
ruby -w hello-rabbit.rb
) yields:Workaround would be to squelch warnings on a case by case basis such as wrapping all Bunny operations like so:
However, this method cannot squelch the uninitialized variable warnings emitted while idling (which I think is from the heartbeat code). Furthermore, this hides all warnings, legitimate or subjectively otherwise.
Bunny version: 2.11 RabbitMQ version: 3.7.5 Steps to reproduce: run
ruby -w hello-rabbit.rb