Pry does not drop me into its REPL at the breakpoint in the following function.
def print_lines(data)
puts "here's the input I got:"
data.each_with_index do |line, index|
url_regex = /(?:<a href=")(https?:\/{2}www.\w+[.](com|org|net)((\/\w+)*([.]\w+)?))(?:">)/
binding.pry
url = line.scan(url_regex)[0]
puts "Line #{index}: #{url}"
end
end
Instead, it produces the following output:
From: /Users/hsb/work/hr-solutions/detect-html-links/lib/script.rb @ line 13 Object#print_lines:
4: def print_lines(data)
...
=> 13: url = line.scan(url_regex)[0]
...
19: end
(END)
When I type q
, pry display the same output for each remaining iteration of the loop. Any idea why I'm not getting access to the REPL to investigate variables in the scope?