After following these instructions to generate a Rails 3
application:
http://oscardelben.com/articles/2009/12/06/how-to-test-rails-3.html
...I noticed a problem with the AppGenerator. I'm having trouble
getting my Rails 3 tests to run, so apologies for not being able to
provide a patch or failing test case.
If you run "rails test-project" from the Rails 3 pre gem you'll
see that the application name ends up being invalid. This is
immediately apparent if you look in config.ru, but the name is used
elsewhere as well.
I see that app_generator.rb is calling classify on line 185. I'm
taking a wild guess that this may be the area of concern...?
'test-project'.classify => "Test-project"
Perhaps an error could be raised if an invalid application name
was provided, or the name could be converted in a more robust way.
I'm sure there's a better way to accomplish the latter, but one
possible solution might be something like:
'test-project'.gsub(/[^[:alpha:]]/, '_').classify => "TestProject"
...or even...
'test....project'.gsub(/[^[:alpha:]]/, '_').squeeze('_').classify
I think this warrants more discussion, but I wanted to kick
things off at least.
Thanks!