-
-
Save lgmkr/3175398 to your computer and use it in GitHub Desktop.
give-it-a-pry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In a rails app | |
pry(main)>.ls | |
Capfile Gemfile.lock Rakefile config db lib public test vendor | |
Gemfile README.md app config.ru doc log script tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)> file_path = '~/.pryrc' | |
=> "~/.pryrc" | |
pry(main)> .ls #{file_path} | |
# /Users/jjackson/.pryrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)> cd Article | |
pry(Article)>ls -mj --grep validate #many options here (--help to learn more), this one will list all singleton methods and search for validate methods | |
#=> _validate_callbacks | |
### at any point call 'nesting' to get an overview of where you are at. | |
pry(main)> nesting | |
# => | |
# Nesting status: | |
# -- | |
# 0. main (Pry top level) | |
# 1. Article |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)>cd Pry | |
pry(Pry)>show-method run_command | |
# => | |
# Number of lines: 4 | |
# | |
# def run_command(val, target = binding_stack.last) | |
# process_line(val, "", target) | |
# Pry::CommandContext::VOID_VALUE | |
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in ~/.pryrc | |
Pry.config.editor = "mate" | |
# then you can simply type | |
pry(main)> edit -t # opens temp-file in TextMate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)>cd Pry | |
pry(Pry)>edit-method -m run_command | |
# File will open in your editor to line 156 of pry_class.rb ^_^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gist-method options | |
# -m, --method Gist a method's source. | |
# -d, --doc Gist a method's documentation. | |
# -p, --private Create a private gist (default: true) | |
# -h, --help This message | |
pry(Pry):1> gist-method run_command | |
#=> Gist created at https://gist.github.com/1277098 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment