Racksh: A Rails-Console-A-Like for Rack-Based Ruby Apps
Racksh is a console for Rack based ruby web applications. It allows you run a console in the context of an application environment for Rails, Merb, Sinatra, Camping, Ramaze (or even your own framework) provided there is a rackup file in the root directory.
When you run the
racksh command, it loads the whole application environment just like a Rack web server, but instead of running the app it starts an irb session where you can invoke commands.
$ racksh Rack::Shell v0.9.4 started in development environment. > Article.all => # returns all articles...
As of version 0.9.4 (released this week), racksh uses Bryan Helmkamp's rack-test to simulate HTTP requests to your Rack application via the $rack variable.
$ racksh Rack::Shell v0.9.4 started in development environment. > $rack.get "/" => # returns a Rack::MockResponse
Racksh also allows you to apply configuration through a .rackshrc file. This can be used to set headers which will be used for requests, or to make additional setup requests (e.g. to make sure a user is logged in).
Install as a gem from Gemcutter, or get the source from Github.
gem install racksh -s http://gemcutter.org