Skip to content

Instantly share code, notes, and snippets.

@benolee
Created May 18, 2012 15:15
Show Gist options
  • Save benolee/2725802 to your computer and use it in GitHub Desktop.
Save benolee/2725802 to your computer and use it in GitHub Desktop.
showing pry's find-method stuff
$ pry
1.9.3 (main):0 > find-method puts
#<Class:0x000000018326c8>#puts
#<Module:0x00000001743398>#puts
IO
IO#puts
IO::writable
IO::writable#puts
Kernel
Kernel.puts
Kernel
Kernel#puts
1.9.3 (main):0 > help find-method
Usage: find-method [-n | -c] METHOD [NAMESPACE]
Recursively search for a method within a Class/Module or the current namespace.
Use the `-n` switch (the default) to search for methods whose name matches the given regex.
Use the `-c` switch to search for methods that contain the given code.
e.g find re Pry # find all methods whose name match /re/ inside the Pry namespace. Matches Pry#repl, etc.
e.g find -c 'output.puts' Pry # find all methods that contain the code: output.puts inside the Pry namepsace.
options:
-n, --name Search for a method by name
-c, --content Search for a method based on content in Regex form
-h, --help Show this message.
1.9.3 (main):0 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment