Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pirj
Created February 23, 2019 10:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pirj/9d28e54be56e07a3c0a47c20a11615d0 to your computer and use it in GitHub Desktop.
Save pirj/9d28e54be56e07a3c0a47c20a11615d0 to your computer and use it in GitHub Desktop.
Ruby REPL when `pry` is not there
while(true) do
begin
print '> '
input = STDIN.readline.chop
output = eval(input)
puts "=> #{output}"
rescue StandardError => e
puts "Error: #{e.message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment