Skip to content

Instantly share code, notes, and snippets.

@ku1ik
Last active August 29, 2015 14:24
Show Gist options
  • Save ku1ik/1c44512cac222c8afea7 to your computer and use it in GitHub Desktop.
Save ku1ik/1c44512cac222c8afea7 to your computer and use it in GitHub Desktop.
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