Sha256: f4ae0709de6624589c2a02a75f7d5b96539d64e593eca2ed7741b4971f5f6385
Contents?: true
Size: 713 Bytes
Versions: 1
Compression:
Stored size: 713 Bytes
Contents
require "net/http" define_command :startrek, doc: "Play a Star Trek animation file" do buffer = Buffer.find_or_new("*startrek*", undo_limit: 0, read_only: true) switch_to_buffer(buffer) buffer.read_only_edit do buffer.replace("") end message("Loading...") background do s = Net::HTTP.get(URI("http://artscene.textfiles.com/vt100/startrek.vt")) frames = s.sub(/\A\e\[H\e\[J\n/, "").split(/\e\[H\n/) foreground do message("") end frames.each do |frame| foreground do buffer.read_only_edit do buffer.replace(frame) end end sleep(0.1) end foreground do message("END") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
textbringer-startrek-1.0.1 | lib/textbringer/startrek.rb |