Pry — the good parts!

Pry — the good parts!

A whirlwind tour through the good parts of pry (the featureful alternative to ruby's irb).

If you've never used pry before, this should get you well on your way to understanding it. If you have, I can guarantee you'll learn something new :).

46d1ebbb28ce0f4a8f2c77b6d3d95829?s=128

Conrad Irwin

April 30, 2013
Tweet

Transcript

  1. group :development do gem ‘pry-rails’ gem ‘pry-plus’ end

  2. What’s  Pry?   •   “like  irb,  but  be4er”    

    •  Everything  you  need  to  program  in  Ruby   •  (apart  from  a  text  editor)     •  60%  of  your  Fme  is  spent  debugging!        
  3. Brief  history   •  2010:  John  Mair  (@banisterfiend)  created  pry

      •  2011:  Ryan  Fitzgerald  (@rrff__)  and  I  joined  in   •  2012:  reached  1,000,000  downloads   –  Kyrylo  Silin  (@kyrylosilin)  and  rking   (@sharpsawDOTorg)  started  contribuFng   •  2013:  reached  2,000,000  downloads   –  71  disFnct  contributors  
  4. Debugging  a  blog  engine   •  IntroducFon   •  How

     do  I  use  the  Base64  library?   •  Why  doesn’t  my  method  work?   •  Where  did  that  nil  come  from?   •  Further  reading  
  5. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  6. How  do  I  use  the  Base64  library?     $

    pry pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  7. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  8. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  9. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  10. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64
  11. How  do  I  use  the  Base64  library?     $

    pry [1] pry(main)> require ‘base64’ => true [2] pry(main)> ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)>
  12. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> (“hi”) => “aGk=\n” [4] pry(main)> Base64.decode64(_) => “hi”
  13. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64(“hi”) => “aGk=\n” [4] pry(main)> Base64.decode64(_) => “hi”
  14. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.enc<tab>4(“hi”) => “aGk=\n” [4] pry(main)> Base64.decode64(_) => “hi”
  15. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64(“hi”) => “aGk=\n” [4] pry(main)> Base64.decode64(_) => “hi”
  16. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64 “hi”) => “aGk=\n” [4] pry(main)> Base64.decode64(_) => “hi”
  17. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64 “hi” => “aGk=\n” [4] pry(main)> Base64.decode64 _ => “hi”
  18. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64 “hi” => “aGk=\n” [4] pry(main)> Base64.decode64 _ => “hi”
  19. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64 “hi” => “aGk=\n” [4] pry(main)> Base64.decode64 _ => “hi”
  20. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [3] pry(main)> Base64.encode64 “hi” => “aGk=\n” [4] pry(main)> Base64.decode64 _ => “hi”
  21. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [5] pry(main)>
  22. How  do  I  use  the  Base64  library?   [2] pry(main)>

    ls Base64 Base64.methods: decode64 encode64 strict_decode64 strict_encode64 urlsafe_decode64 urlsafe_encode64 [5] pry(main)> ? Base64.strict_encode64
  23. How  do  I  use  the  Base64  library?   [5] pry(main)>

    ? Base64.strict_encode64 From: ~/ruby-1.9.3/lib/ruby/base64.rb Owner: #<Class:Base64> Visibility: public Signature: strict_encode64(bin) Returns the Base64-encoded version of bin. This method complies with RFC 4648. No line feeds are added.
  24. How  do  I  use  the  Base64  library?   [5] pry(main)>

    ? Base64.encode64 From: ~/ruby-1.9.3/lib/ruby/base64.rb Owner: #<Class:Base64> Visibility: public Signature: encode64(bin) Returns the Base64-encoded version of bin. This method complies with RFC 2045. Line feeds are added every 60 characters.
  25. How  do  I  use  the  Base64  library?   •  Evaluate

     ruby  code.   •  Colour   •  Tab-­‐compleFon   •  _  (the  last  output)   •  ls  (list  methods)   •  ?  (show-­‐doc)  
  26. Debugging  a  blog  engine   •  IntroducFon   •  How

     do  I  use  the  Base64  library?   •  Why  doesn’t  my  method  work?   •  Where  did  that  nil  come  from?   •  Further  reading  
  27. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    require ‘base64’ module BasicAuth def self.encode(username, password) s = [username, password].join(“:”) “Basic #{Base64.strict_encode64 s}” end def self.decode(header) base64 = header[/Basic (.*)/, 1] Base64.decode64 base64.split(“:”) end end
  28. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    require ‘base64’ module BasicAuth def self.encode(username, password) s = [username, password].join(“:”) “Basic #{Base64.strict_encode64 s}” end def self.decode(header) base64 = header[/Basic (.*)/, 1] Base64.decode64 base64.split(“:”) end end
  29. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    [2] pry(main)> require _file_ => true [3] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [4] pry(main)> BasicAuth.decode _ NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [4] pry(main)> wtf? 0’
  30. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    [2] pry(main)> require _file_ => true [3] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [4] pry(main)> BasicAuth.decode _ NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [4] pry(main)> wtf? 0’
  31. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    [2] pry(main)> require _file_ => true [3] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [4] pry(main)> BasicAuth.decode _ NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [4] pry(main)> wtf? 0’
  32. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    [2] pry(main)> require _file_ => true [3] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [4] pry(main)> BasicAuth.decode _ NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [5] pry(main)> wtf? 0’
  33. Why  doesn’t  my  method  work?   [1] pry(main)> cat basic_auth.rb

    [2] pry(main)> require _file_ => true [3] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [4] pry(main)> BasicAuth.decode _ NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [5] pry(main)> wtf? 0’
  34. Why  doesn’t  my  method  work?   [4] pry(main)> BasicAuth.decode _

    NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [5] pry(main)> wtf? 0: ~/ruby-1.9.3/lib/ruby/base64.rb:58 in `decode’ 1: ~/basic_auth.rb:10 in `decode’ 2: (pry):3 in `__pry__’
  35. Why  doesn’t  my  method  work?   [4] pry(main)> BasicAuth.decode _

    NoMethodError: undefined method `unpack’ for [“aGk6bXVt”]:Array [5] pry(main)> wtf? 0: ~/ruby-1.9.3/lib/ruby/base64.rb:58 in `decode64’ 1: ~/basic_auth.rb:10 in `decode’ 2: (pry):3 in `__pry__’ [6] pry(main)>
  36. Why  doesn’t  my  method  work?   [5] pry(main)> wtf? 0:

    ~/ruby-1.9.3/lib/ruby/base64.rb:58 in `decode64’ 1: ~/basic_auth.rb:10 in `decode’ 2: (pry):3 in `__pry__’ [6] pry(main)> $ BasicAuth.decode
  37. Why  doesn’t  my  method  work?   [5] pry(main)> wtf? 0:

    ~/ruby-1.9.3/lib/ruby/base64.rb:58 in `decode64’ 1: ~/basic_auth.rb:10 in `decode’ 2: (pry):3 in `__pry__’ [6] pry(main)> show-source BasicAuth.decode
  38. Why  doesn’t  my  method  work?   [6] pry(main)> $ BasicAuth.decode

    From: ~/basic_auth.rb Owner: #<Class:BasicAuth> Visibility: public Number of lines: 4 def self.decode(header) base64 = header[/Basic (.*)/, 1] Base64.decode64 base64.split(“:”) end
  39. Why  doesn’t  my  method  work?   [5] pry(main)> wtf? 0:

    ~/ruby-1.9.3/lib/ruby/base64.rb:58 in `decode64’ 1: ~/basic_auth.rb:10 in `decode’ 2: (pry):3 in `__pry__’ [6] pry(main)> $ BasicAuth.decode [7] pry(main)> edit
  40. Why  doesn’t  my  method  work?   [6] pry(main)> $ BasicAuth.decode

    [7] pry(main)> edit <alt+_>
  41. Why  doesn’t  my  method  work?   [6] pry(main)> $ BasicAuth.decode

    [7] pry(main)> edit <alt+_> (on Linux) <esc>_ (on a Mac)
  42. Why  doesn’t  my  method  work?   [6] pry(main)> $ BasicAuth.decode

    [7] pry(main)> edit BasicAuth.decode
  43. None
  44. None
  45. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)>
  46. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> <ctrl+r>
  47. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> (reverse-i-search)`’:
  48. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ (reverse-i-search)`enc’
  49. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [9] pry(main)>
  50. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [9] pry(main)> BasicAuth.decode _ => [“hi”, “mum”] [10] pry(main)>
  51. Why  doesn’t  my  method  work?   [7] pry(main)> edit BasicAuth.decode

    [8] pry(main)> BasicAuth.encode ‘hi’, ‘mum’ => “Basic aGk6bXVt” [9] pry(main)> BasicAuth.decode _ => [“hi”, “mum”] [10] pry(main)>
  52. Why  doesn’t  my  method  work?   •  wd?  (show  backtrace,

     also  _ex_.backtrace)   •  $  (show-­‐source)   •  edit  (uses  $EDITOR)   •  <Alt+_>,  <esc>_  (copy  last  word  down)   •  <ctrl+r>  (search  history)   •  _file_  (last  shown  file,  also  _dir_)   •  _out_  (array  of  all  output  values,  also  _in_)  
  53. Debugging  a  blog  engine   •  IntroducFon   •  How

     do  I  use  the  Base64  library?   •  Why  doesn’t  my  method  work?   •  Where  did  that  nil  come  from?   •  Further  reading  
  54. Where  did  that  nil  come  from?   $ ruby post.rb

    post.rb:11:in `make_safe': undefined method `gsub' for nil:NilClass (NoMethodError) from post.rb:7:in `safe_title' from post.rb:19:in `<main>’ $
  55. Where  did  that  nil  come  from?   $ ruby post.rb

    post.rb:11:in `make_safe': undefined method `gsub' for nil:NilClass (NoMethodError) from post.rb:7:in `safe_title' from post.rb:19:in `<main>’ $ subl post.rb
  56. None
  57. None
  58. Where  did  that  nil  come  from?   $ subl post.rb

    $  
  59. Where  did  that  nil  come  from?   $ subl post.rb

    $ ruby post.rb  
  60. Where  did  that  nil  come  from?   $ subl post.rb

    $ ruby post.rb From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [1] pry(main)>
  61. Where  did  that  nil  come  from?   $ subl post.rb

    $ ruby post.rb From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [1] pry(main)> play –l 19
  62. Where  did  that  nil  come  from?   $ subl post.rb

    $ ruby post.rb From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [1] pry(main)> puts new_post.safe_title
  63. Where  did  that  nil  come  from?   $ subl post.rb

    $ ruby post.rb From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [1] pry(main)> play –l 19 NoMethodError: undefined method `gsub' for nil
  64. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)>
  65. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post
  66. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post [3] pry(#<Post>):1>
  67. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post [3] pry(#<Post>):1> ls
  68. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post [3] pry(#<Post>):1> ls Post#methods: make_safe safe_title instance variables: @params locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_ [4] pry(#<Post>):1>
  69. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post [3] pry(#<Post>):1> ls Post#methods: make_safe safe_title instance variables: @params locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_ [4] pry(#<Post>):1> $ safe_title
  70. Where  did  that  nil  come  from?   [1] pry(main)> puts

    new_post.safe_title NoMethodError: undefined method `gsub' for nil [2] pry(main)> cd new_post [3] pry(#<Post>):1> ls Post#methods: make_safe safe_title instance variables: @params locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_ [4] pry(#<Post>):1> $ Post#safe_title
  71. Where  did  that  nil  come  from?   [4] pry(#<Post>):1> $

    safe_title From: post.rb @ line 7: Number of lines: 3 Owner: Post Visibility: public def safe_title make_safe @params[:title] end [5] pry(#<Post>):1>
  72. Where  did  that  nil  come  from?   [4] pry(#<Post>):1> $

    safe_title From: post.rb @ line 7: Number of lines: 3 Owner: Post Visibility: public def safe_title make_safe @params[:title] end [5] pry(#<Post>):1> @params
  73. Where  did  that  nil  come  from?   [4] pry(#<Post>):1> $

    safe_title From: post.rb @ line 7: Number of lines: 3 Owner: Post Visibility: public def safe_title make_safe @params[:title] end [5] pry(#<Post>):1> @params {“title”=>”new post”, “body”=>”your text here”} [6] pry(#<Post>):1>
  74. Where  did  that  nil  come  from?   [4] pry(#<Post>):1> $

    safe_title From: post.rb @ line 7: Number of lines: 3 Owner: Post Visibility: public def safe_title make_safe @params[:title] end [5] pry(#<Post>):1> @params {“title”=>”new post”, “body”=>”your text here”} [6] pry(#<Post>):1> edit --ex
  75. None
  76. None
  77. Where  did  that  nil  come  from?   [5] pry(#<Post>):1> @params

    {“title”=>”new post”, “body”=>”your text here”} [6] pry(#<Post>):1> edit --ex [7] pry(#<Post>):1>
  78. Where  did  that  nil  come  from?   [5] pry(#<Post>):1> @params

    {“title”=>”new post”, “body”=>”your text here”} [6] pry(#<Post>):1> edit --ex [7] pry(#<Post>):1> .git diff
  79. Where  did  that  nil  come  from?   [7] pry(#<Post>):1> .git

    diff diff --git a/post.rb b/post.rb index d0ed356..057d37c 100644 --- a/post.rb +++ b/post.rb @@ -4, 7 +4,7 @@ class Post end def safe_title - make_safe @params[:title] + make_safe @params[‘title’] end [8] pry(#<Post>):1>
  80. Where  did  that  nil  come  from?   [7] pry(#<Post>):1> .git

    diff diff --git a/post.rb b/post.rb index d0ed356..057d37c 100644 --- a/post.rb +++ b/post.rb @@ -4, 7 +4,7 @@ class Post end def safe_title - make_safe @params[:title] + make_safe @params[‘title’] end [8] pry(#<Post>):1> cd ..
  81. Where  did  that  nil  come  from?   [8] pry(#<Post>):1> cd

    .. [9] pry(main)>
  82. Where  did  that  nil  come  from?   [8] pry(#<Post>):1> cd

    .. [9] pry(main)> whereami
  83. Where  did  that  nil  come  from?   [8] pry(#<Post>):1> cd

    .. [9] pry(main)> whereami From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [10] pry(main)>
  84. Where  did  that  nil  come  from?   [8] pry(#<Post>):1> cd

    .. [9] pry(main)> whereami From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [10] pry(main)> puts new_post.safe_title
  85. Where  did  that  nil  come  from?   [9] pry(main)> whereami

    From: post.rb @ line 18 : 15: new_post = Post.new( 16: 'title' => 'new post', 17: 'body' => 'your text here') => 18: binding.pry # Added for debugging 19: puts new_post.safe_title [10] pry(main)> puts new_post.safe_title new-post => nil [11] pry(main)>
  86. Where  did  that  nil  come  from?   [10] pry(main)> puts

    new_post.safe_title new-post => nil [11] pry(main)> puts new_post.safe_title;
  87. Where  did  that  nil  come  from?   [10] pry(main)> puts

    new_post.safe_title new-post => nil [11] pry(main)> puts new_post.safe_title; new-post [12] pry(main)>
  88. Where  did  that  nil  come  from?   [10] pry(main)> puts

    new_post.safe_title new-post => nil [11] pry(main)> puts new_post.safe_title; new-post [12] pry(main)> <ctrl+d>
  89. Where  did  that  nil  come  from?   [10] pry(main)> puts

    new_post.safe_title new-post => nil [11] pry(main)> puts new_post.safe_title; new-post [12] pry(main)> new-post $
  90. Where  did  that  nil  come  from?   •  binding.pry  (open

     pry  right  here,  right  now)   •  cd  (change  self)   •  whereami   •  edit  -­‐-­‐ex   •  play  -­‐l   •  .  (run’s  shell  commands)   •  <ctrl-­‐d>  (cd  ..  or  exit)   •  ;  (at  end  of  line,  hides  output)  
  91. Debugging  a  blog  engine   •  IntroducFon   •  How

     do  I  use  the  Base64  library?   •  Why  doesn’t  my  method  work?   •  Where  did  that  nil  come  from?   •  Further  reading  
  92. pry-­‐rescue/pry-­‐stack_explorer   •  pry-­‐rescue   – AutomaFcally  opens  pry  wherever  you

     have  an   unhandled  excepFon  or  test  failure.   – cd-­‐cause  lets  you  pry  into  any  excepFon  that   happens  inside  the  console       •  pry-­‐stack_explorer   – lets  you  move  up/down  the  callstack  as  though   you  had  a  binding.pry  at  every  level    
  93. be4er_errors   •  BetterErrors.use_pry! •  Opens  a  web  page  on

     unhandled  excepFons   •  Lets  you  debug  your  program  amer  it  crashes  
  94. None
  95. pry-­‐debugger   •  break   – Adds  a  breakpoint   • 

    step/next   – Step  into  or  over  the  next  line     •  conFnue   – Stop  stepping  through    
  96. Recommended  plugins   •  pry-­‐plus   – pry-­‐debugger,  pry-­‐rescue,  pry-­‐stack_explorer  

    – pry-­‐doc,  documentaFon  for  C  methods   – pry-­‐docmore,  documentaFon  for  ruby  syntax   – bond,  tab  compleFon  for  Hash#[],  etc.   – jist,  IntegraFon  with  gist.github.com   •  pry-­‐rails   – makes  “rails  c”  use  pry!  
  97. • 60%  of  your  Fme  is  spent   debugging   • use

     binding.pry  
  98. QuesFons?!   •  Pry  (@pryrepl)   – h4p://pryrepl.org   – irc://irc.freenode.net/#pry  

    – type  “help”  in  pry  :)   •  Conrad  Irwin  (@ConradIrwin)   – h4p://cirw.in   – irc://irc.freenode.net/cirwin