rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 553 forks source link

🌈 Fix another warning about $thor_runner #718

Closed bpo closed 4 years ago

bpo commented 4 years ago

Last patch for me today - this was what I was originally trying to do:

Previously ruby -w, when running an unknown command in Thor, a warning was printed:

thor-1.0.1/lib/thor/base.rb:514: warning: global variable `$thor_runner' not initialized

This was raised earlier in #633 but the fix was incomplete -- the global variable was being lazily defined in a method which is not the only entry point to Thor. This moves the global definition out to where the Thor class is defined.