Skip to content

Instantly share code, notes, and snippets.

@pmeinhardt
Created July 18, 2012 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmeinhardt/3135332 to your computer and use it in GitHub Desktop.
Save pmeinhardt/3135332 to your computer and use it in GitHub Desktop.
patch irb completion
--- completion.rb 2012-07-18 11:48:41.000000000 +0200
+++ completion-2.rb 2012-07-18 11:53:02.000000000 +0200
@@ -165,6 +165,7 @@
rescue Exception
name = ""
end
+ next unless name.class == String
next if name != "IRB::Context" and
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
@PragTob
Copy link

PragTob commented Sep 18, 2012

Hm dunno if they do anything about it, but maybe you could check out irb-tools or pry for more command line awesomeness :-)

@pmeinhardt
Copy link
Author

Yeah, thanks. I've used these before, but this was really a different thing (it's been a while, but roughly the following issue): IRB and Rails console were crashing on this line when trying to tab-complete a statement with multiple method invocations (i.e. multiple dots, like User.first.+Tab). Quite annoying. Never happened to me again ever since. My rbenv-installed versions work fine as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment