Guest User

Untitled

a guest
Feb 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # Shoes-IRB made by ~devyn
  2. require 'irb'
  3.  
  4. Shoes.app do
  5. background black
  6. @p = para '', :family => 'monospace', :color => white
  7. @sreader, @swriter = StringIO.new, StringIO.new
  8. Thread.start do
  9. @irb = IRB::Irb.new(nil, @sreader, @swriter)
  10. loop do
  11. @irb.eval_input
  12. end
  13. end
  14. animate(24) do
  15. c = @swriter.getc
  16. @p.text += c.chr if c
  17. end
  18. keypress do |k|
  19. if k.class == String
  20. @sreader.write k
  21. elsif (k == :enter) or (k == :return)
  22. @sreader.write "\n"
  23. end
  24. end
  25. end
Add Comment
Please, Sign In to add comment