Last active
August 29, 2015 14:24
-
-
Save ku1ik/1c44512cac222c8afea7 to your computer and use it in GitHub Desktop.
The simplest asciicast player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This plays asciicast (v1 format - https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md) in your terminal: | |
# ruby play.rb asciicast.json | |
require 'json' | |
JSON.parse(File.read(ARGV[0]))['stdout'].each do |frame| | |
sleep frame[0] | |
STDOUT.write frame[1] | |
STDOUT.flush | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment