examples/http_0mq.rbis a test little servlet thing (based on what comes with mongrel2).
examples/rack_handler.rbis a Mongrel2 ruby handler rack handler mouthful, whose variables are probably a little off.
examples/lobster.ruis a rackup file using the Rack handler that'll serve Rack's funny little lobster app.
ruby examples/http_0mq.rb, which with Mongrel2's test config will serve up at http://localhost:6767/handlertest
rackup examples/lobster.ru, ditto, http://localhost:6767/handlertest
With rails3: Add this to your Gemfile:
gem 'ffi' gem 'ffi-rzmq' gem 'json'
And this to your config.ru:
$: << location_to_m2r + '/example' require 'rack_handler' Rack::Handler::Mongrel2.run YourRailsAppName::Application
Then do all like
bundle exec rackup
- JRuby 1.5+ (don't use MRI - it will crash horribly, check the ISSUES file)
gem install ffishould be fine.
- Zero MQ, you'll need to compile and install to get the headers and such for:
- ffi-rzmq, which you'll have to build. The native zmq didn't work for me, but if you want to fix it, please do!
- json, since the headers are returned in JSON, which is RAD. (Really Awesome, Dude)
gem install rackif you want to run the rack example.
Once you've made your great commits:
- Fork m2r
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Send a pull request