Code Monkey home page Code Monkey logo

ripl-rack's Introduction

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
#<Ripl::Rack::App:0x3f8cc @env="development" ... >

# 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

ripl-rack's People

Contributors

cldwalker avatar kukushkin avatar wifelette avatar

Forkers

pmt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.