Created
November 19, 2008 02:00
-
-
Save devyn/26375 to your computer and use it in GitHub Desktop.
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
# 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