Skip to content

Commit

Permalink
Merge pull request #22447 from LaithSaq/patch-2
Browse files Browse the repository at this point in the history
replaced require 'pry' with require 'pry-byebug'
  • Loading branch information
wise-king-sullyman authored Jul 15, 2021
2 parents db45a1b + 08a1b14 commit f7c8b80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ruby_programming/basic_ruby/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ p []
### Debugging with Pry-byebug
[Pry](https://github.com/pry/pry) is a Ruby gem that provides you with an interactive [REPL](https://www.rubyguides.com/2018/12/what-is-a-repl-in-ruby/) while your program is running. The REPL provided by Pry is very similar to IRB but has added functionality. The recommended Ruby gem for debugging is [Pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) and it includes Pry as a dependency. Pry-byebug adds step-by-step debugging and stack navigation.

To use Pry-byebug, you'll first need to install it in your terminal by running `gem install pry-byebug`. You can then make it available in your program by requiring it at the top of your file with `require 'pry'`. Finally, to use Pry-byebug, you just need to call `binding.pry` at any point in your program.
To use Pry-byebug, you'll first need to install it in your terminal by running `gem install pry-byebug`. You can then make it available in your program by requiring it at the top of your file with `require 'pry-byebug'`. Finally, to use Pry-byebug, you just need to call `binding.pry` at any point in your program.

To follow along with these examples save the code into a Ruby file (e.g., `script.rb`) and then run the file in your terminal (e.g., `ruby script.rb`)

~~~ruby
require 'pry'
require 'pry-byebug'

def double_words_in_phrase(string)
string_array = string.split(' ')
Expand All @@ -130,7 +130,7 @@ When your code executes and gets to `binding.pry`, it will open an IRB-like sess
To see this point in action, try running the following:

~~~ruby
require 'pry'
require 'pry-byebug'

def yell_greeting(string)
name = string
Expand Down

0 comments on commit f7c8b80

Please sign in to comment.