Embed presentation
Download as PDF, PPTX



![2 - History
[4] pry(main)> hist
1: (0..5).each do |number|
2: puts number
3: end](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-4-320.jpg)
![2 - History - replay
[5] pry(main)> hist --replay 1..3
0
1
…](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-5-320.jpg)
![2 - History - all
[35] pry(main)> hist --all --tail 100
Use --all option to list all pry history](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-6-320.jpg)
![[6] pry(main)> def fullname
[7] pry(main)> [first, last].compact.join(' ')
[8] pry(main)> edit
3 - Editor](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-7-320.jpg)

![3 - Editor
[9] pry(main)> fullname('John', 'Doe')
=> "John Doe"](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-9-320.jpg)

![4 - Copy to clipboard
gem install gist
[9] pry(main)> clipit fullname
Copied content to clipboad!](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-11-320.jpg)

![5 - Reload
[1] pry(main)> user = User.last
[2] pry(main)> edit user
with PRY](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-13-320.jpg)

![[1] pry(main)> user = User.last
[2] pry(main)> edit user
[2] pry(main)> user.fullname
=> "John Doe"
5 - Reload
with PRY](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-15-320.jpg)


Pry is a Ruby shell that provides an interactive environment for experimenting and debugging code. It allows users to: 1. List methods, show documentation, and view source code using commands like ls, ?, and $. 2. View and replay command history. 3. Edit code directly from the Pry session by configuring an editor in the .pryrc file. 4. Copy code to the clipboard using the clipit command after installing the gist gem. 5. Reload code like reloading files or classes without restarting the Pry session.



![2 - History
[4] pry(main)> hist
1: (0..5).each do |number|
2: puts number
3: end](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-4-320.jpg)
![2 - History - replay
[5] pry(main)> hist --replay 1..3
0
1
…](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-5-320.jpg)
![2 - History - all
[35] pry(main)> hist --all --tail 100
Use --all option to list all pry history](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-6-320.jpg)
![[6] pry(main)> def fullname
[7] pry(main)> [first, last].compact.join(' ')
[8] pry(main)> edit
3 - Editor](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-7-320.jpg)

![3 - Editor
[9] pry(main)> fullname('John', 'Doe')
=> "John Doe"](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-9-320.jpg)

![4 - Copy to clipboard
gem install gist
[9] pry(main)> clipit fullname
Copied content to clipboad!](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-11-320.jpg)

![5 - Reload
[1] pry(main)> user = User.last
[2] pry(main)> edit user
with PRY](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-13-320.jpg)

![[1] pry(main)> user = User.last
[2] pry(main)> edit user
[2] pry(main)> user.fullname
=> "John Doe"
5 - Reload
with PRY](https://image.slidesharecdn.com/pry-151104162746-lva1-app6891/85/Some-Pry-Features-15-320.jpg)
