Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rbranson/104640 to your computer and use it in GitHub Desktop.

Select an option

Save rbranson/104640 to your computer and use it in GitHub Desktop.
#
# This monkeypatch will tell IRB completion to ignore methods that also
# happen to be in the "Object" class as most of the time I don't care
# about these. This hack only steps in when you've entered something like
# "foo." or "Foo." or "Foo::", otherwise you'll be working with the
# full list of methods, including the ones from Object. k?
#
Readline.completion_proc = proc do |input|
IRB::InputCompletor::CompletionProc.call(input).reject do |o|
o == nil or (input =~ /(\.|::)$/ and Object.methods.include?(o[/[^\.:]*$/]))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment