Skip to content

Instantly share code, notes, and snippets.

@devyn
Created November 19, 2008 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devyn/26375 to your computer and use it in GitHub Desktop.
Save devyn/26375 to your computer and use it in GitHub Desktop.
# Shoes-IRB made by ~devyn
require 'irb'
Shoes.app do
background black
@p = para '', :family => 'monospace', :color => white
@sreader, @swriter = StringIO.new, StringIO.new
Thread.start do
@irb = IRB::Irb.new(nil, @sreader, @swriter)
loop do
@irb.eval_input
end
end
animate(24) do
c = @swriter.getc
@p.text += c.chr if c
end
keypress do |k|
if k.class == String
@sreader.write k
elsif (k == :enter) or (k == :return)
@sreader.write "\n"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment