Readline is a really useful library for textual user interfaces. Unfortunately, the Ruby interface has very limited functionality. This gem adds access to the full line buffer during completion. The biggest milestone before 1.0 is to similarly wrap jline for jRuby, and do it such that client code doesn't need to determine it's platform ahead of time.
Gemfile gem 'orichalcum', '~> 0.5.0'
install gem install orichalcum