Sha256: b84f6e720ab862298b0b74c49f82a79dafc00839ebb4b726e383c242254838fd

Contents?: true

Size: 1.94 KB

Versions: 2

Compression:

Stored size: 1.94 KB

Contents

== Description
A ripl plugin to playback ruby code in ripl coming from files, urls or stdin. Also records a ripl
session for playback later.

== Install
Install the gem with:

    sudo gem install ripl-play

To be able to playback multi-line code:

    sudo gem install ripl-multi_line

    # Add to ~/.riplrc
    require 'ripl/multi_line'

== Usage

<tt>ripl play</tt> plays its input, line by line, as if each line were input by a user.

To play a url:

    $ ripl play https://gist.github.com/725338
    >> a = 10 ** 2
    => 100
    >> a + 10
    => 110
    >>

To playback a url quietly (i.e. you just want to load the url into ripl):

    $ ripl play https://gist.github.com/725338 -q
    >> a = 10 ** 2
    >> a + 10
    >>

To playback a url with relevant gems automatically installed (you may want to create an rvm
gemset before doing this)

    $ ripl play https://gist.github.com/622668 -i
    Can I install the following gems: tilt, erubis ? ([y]/n)
    ....

Urls should point to raw text except for gists and any github file url
({like this}[https://github.com/cldwalker/irbfiles/blob/master/boson/commands/core/string.rb])
which are autoconverted.

<tt>ripl play</tt> can also playback files or from stdin:

    # Plays script.rb line by line
    $ ripl play script.rb
    >> ...

    # Plays back last 10 lines of irb history
    $ tail -10 ~/.irb_history | ripl play
    >> ...

If you want to share a ripl session for playback later, start ripl with record:

    # By default record saves to ripl_tape. Pass an argument to explicitly name the file
    $ ripl record
    >> :do_something
    => :do_something
    >> ...
    => ...
    <Control-D>

After exiting, the file ripl_tape will contain all of your inputs from that session.
Now anyone can playback that session with <tt>ripl play</tt>:

    # play defaults to ripl_tape
    # Assuming you're in the same directory as ripl_tape
    $ ripl play
    >> :do_something
    => :do_something
    >> ...
    => ...
    >>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ripl-play-0.2.1 README.rdoc
ripl-play-0.2.0 README.rdoc