commander-rb / commander

The complete solution for Ruby command-line executables
MIT License
822 stars 74 forks source link

making command state less mutable #68

Closed doriantaylor closed 6 years ago

doriantaylor commented 6 years ago

resolves #67

doriantaylor commented 6 years ago

As for a test I'm not sure what I should be testing: that a Commander::Command instance can be run twice and its @proxy_options field is empty afterward? Anything else?

ggilder commented 6 years ago

Looks good - can you squash the commits?

doriantaylor commented 6 years ago

yeah sure gimme a few…

though—never had anybody ask me to do that before, what's the rationale, just out of curiosity?

ggilder commented 6 years ago

I think this is a pretty good read on the rationale for squashing commits: https://blog.carbonfive.com/2017/08/28/always-squash-and-rebase-your-git-commits/

The TLDR is that it creates a more clear, readable version history. Speaking of that — if you could rewrite that squashed commit to have a clearer commit message describing the change, that would be great. After that I think this is ready to merge!

doriantaylor commented 6 years ago

how's that

ggilder commented 6 years ago

Awesome, thanks! I'll merge that in a sec — would you like me to publish a new version to Rubygems or is that not necessary for your workflow?

doriantaylor commented 6 years ago

that would be great! thanks

ggilder commented 6 years ago

I just released version 4.4.5 with your change. Thanks for contributing!

doriantaylor commented 6 years ago

Awesome! Yeah it seemed like a natural thing to be able to make a :shell command that could run all the other registered commands from inside it. May even be amenable to generalization. If that happens you'll be the first to know.