https://github.com/cldwalker/ripl-play
A ripl plugin to playback and record inputs in ripl
https://github.com/cldwalker/ripl-play
Last synced: 7 months ago
JSON representation
A ripl plugin to playback and record inputs in ripl
- Host: GitHub
- URL: https://github.com/cldwalker/ripl-play
- Owner: cldwalker
- License: mit
- Created: 2010-12-02T15:11:37.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-01-03T14:59:43.000Z (over 15 years ago)
- Last Synced: 2025-03-18T13:32:10.035Z (about 1 year ago)
- Language: Ruby
- Size: 86.9 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- Changelog: CHANGELOG.rdoc
- License: LICENSE.txt
Awesome Lists containing this project
README
== 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
ripl play 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.
ripl play 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
>> ...
=> ...
After exiting, the file ripl_tape will contain all of your inputs from that session.
Now anyone can playback that session with ripl play:
# play defaults to ripl_tape
# Assuming you're in the same directory as ripl_tape
$ ripl play
>> :do_something
=> :do_something
>> ...
=> ...
>>