davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

fix code that computes module_name #59

Closed terryfinn closed 11 years ago

terryfinn commented 11 years ago

Using methadone to create a new app with a name like foo_bar_app, the old code would compute module_name to be Foobarapp when it should be FooBarApp. This results in an error when trying to run the app generated by methadone. The app will crash with an error like:

$ bundle exec bin/foo_bar_app 
bin/foo_bar_app:38:in `<class:App>': uninitialized constant
App::Foobarapp (NameError)
    from bin/foo_bar_app:7:in `<main>'

This code will properly compute the module_name.

davetron5000 commented 11 years ago

Nice catch - yeah the call to captialize on a string lower-cases everything else, which I didn't realize. I'll see why Travis is complaining and then merge this. Thanks for the patch!