Created
January 20, 2013 16:16
-
-
Save blacktm/4579574 to your computer and use it in GitHub Desktop.
An IRB implementation in Ruby.
This file contains hidden or 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
require 'readline' | |
first_run = true | |
loop do | |
if first_run | |
puts | |
puts "Type a command to get started." | |
puts "Type \"exit\" to quit." | |
first_run = false | |
else | |
str = Readline.readline(">> ", true) | |
if str == "exit" then exit end | |
begin | |
puts eval str, TOPLEVEL_BINDING | |
rescue Exception => e | |
puts e | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment