torquebox/torquebox — pull request #42 by dobozysaurus (2011-10-14 17:10:51+00:00)
Title: Fix for TORQUE-563 (Padrino apps don't deploy on TorqueBox 2.x), refactor of TORQUE-519

This fix allows Padrino apps to deploy successfully on TorqueBox 2.x. This necessitated a refactoring of two items:

- Rails app detection. The rails app detection algorithm is now as follows:

1. Look for config/application.rb (Rails 3), read the file, and find a reference to Rails::Application.
2. Look for config/environment.rb (Rails 2), read the file, and find a reference to Rails::Initializer

I'd initially thought of looking for script/rails or script/console, but not all Rails apps (including some of the ones in TB's integration tests) contain the Rails scripts.

- TORQUE-519. Since Padrino apps can also use activerecord, we need to ensure that the VFS monkeypatch for both Rails and Padrino. Since the AR VFS patch will generally be needed whenever using torquebox, I moved it to torquebox-core.

I've added a padrino integration test app, which uses AR for persistence.

One note: For some reason on my system, I had to patch the spec/sinatra_queues_spec.rb. The line:

page.should have_content('TOBY CRAWLEY')

was failing for me - when I changed it to:

page.should have_content('TOBY+CRAWLEY')

it worked fine.