https://github.com/cldwalker/ripl-rack
script/console for rack using ripl
https://github.com/cldwalker/ripl-rack
Last synced: about 1 year ago
JSON representation
script/console for rack using ripl
- Host: GitHub
- URL: https://github.com/cldwalker/ripl-rack
- Owner: cldwalker
- License: mit
- Created: 2010-12-11T21:20:42.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2019-12-24T00:37:30.000Z (over 6 years ago)
- Last Synced: 2025-04-06T18:53:03.246Z (about 1 year ago)
- Language: Ruby
- Size: 142 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- Changelog: CHANGELOG.rdoc
- License: LICENSE.txt
Awesome Lists containing this project
README
== Description
This ripl plugin provides a console for rack apps.
== Install
Install the gem with:
gem install ripl-rack
== Usage
As an executable:
$ ripl rack
Loading development environment (Rack 1.1)
As a plugin:
$ ripl rails -r ripl/rack
Now let's use it:
$ ripl rack
Loading development environment (Rack 1.1)
# your rack app thanks to Rack::Test
>> rack
#
# Make http requests
>> rack.get '/'
>> rack.post '/login', :user => 'x', :password => 'y'
...
# To see what actions you can perform on your app
>> rack.actions
=> [:request, :get, :post, :put, :delete, :head, :follow_redirect!, :header, :set_cookie,
:clear_cookies, :authorize, :basic_authorize, :digest_authorize, :last_response, :last_request]
# To perform these actions even more naturally
>> rackit!
=> [:request, :get, :post, :put, :delete, :head, :follow_redirect!, :header, :set_cookie,
:clear_cookies, :authorize, :basic_authorize, :digest_authorize, :last_response, :last_request]
# All of the above methods are now available at the top level
>> get '/'
>> post '/login', :user => 'x', :password => 'y'
....
To have rack actions in your top-level by default add the following to ~/.riplrc:
Ripl.config[:rackit] = true
== Credits
* Thanks to racksh for interesting rack-test bits
* Thanks to @kukushkin for fixing a reload bug