Skip to content

Instantly share code, notes, and snippets.

@sickill
Last active Aug 29, 2015
Embed
What would you like to do?
The simplest asciicast player
# 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