Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: feature/escape
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (26 sloc) 0.627 kb
$LOAD_PATH.unshift File.expand_path(File.join("lib", File.dirname(__FILE__)))
require 'coolline'
require 'coderay'
require 'pp'
Coolline.bind "\C-z" do |c|
puts c.object_id
end
cool = Coolline.new do |c|
c.transform_proc = proc do
CodeRay.scan(c.line, :ruby).term
end
c.completion_proc = proc do
word = c.completed_word
Object.constants.map(&:to_s).select { |w| w.start_with? word }
end
end
# At some point, it became frustrating to just print lines without showing any
# result.
loop do
line = cool.readline
break if line == "exit\n"
obj = eval(line)
print "=> "
pp obj
end
cool.close
Jump to Line
Something went wrong with that request. Please try again.