Skip to content

Instantly share code, notes, and snippets.

@janlelis
Last active April 8, 2024 09:21
Show Gist options
  • Save janlelis/cb6dbbb2fa4d5be67bba144404e7ec9d to your computer and use it in GitHub Desktop.
Save janlelis/cb6dbbb2fa4d5be67bba144404e7ec9d to your computer and use it in GitHub Desktop.
Minimal Ruby REPL
ruby -e'_,__="",binding;loop do$><<">> "if$/>_
puts"=> %p"%[__.eval(_+=gets||exit!),_=""]
rescue Exception
puts"\e[31m%p\e[0m"%[$!,_=""]if/d e|ee/!~"#$!"end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment