pry-byebug icon indicating copy to clipboard operation
pry-byebug copied to clipboard

PR proposition : Deprecated - Pry.config.control_d_handler

Open thibpoullain opened this issue 3 years ago • 5 comments
trafficstars

Hi,

I'm on rails 7.0.1 and ruby 3.0.3, using pry-byebug 3.9.0.

I got this warning on my rails server command :

/Users/thibaut/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/pry-byebug-3.8.0/lib/pry-byebug/control_d_handler.rb:5: warning: control_d_handler's arity of 2 parameters was deprecated (eval_string, pry_instance). Now it gets passed just 1 parameter (pry_instance)

I checked the file, this is the original :

control_d_handler.rb:5

original_handler = Pry.config.control_d_handler

Pry.config.control_d_handler = proc do |eval_string, pry_instance|
  Byebug.stop if Byebug.stoppable?

  original_handler.call(eval_string, pry_instance)
end

I suggest this (works for me) :

control_d_handler.rb:5

original_handler = Pry.config.control_d_handler

Pry.config.control_d_handler = proc do |pry_instance|
  Byebug.stop if Byebug.stoppable?

  original_handler.call(pry_instance)
end

What do you think ?

thibpoullain avatar Jan 14 '22 07:01 thibpoullain

+1

mark-davenport-fountain avatar Jan 21 '22 14:01 mark-davenport-fountain

Is there any news on this?

23tux avatar Feb 27 '22 09:02 23tux

I have same issue with rails version 6.1.4

caiohenrique12 avatar Mar 16 '22 14:03 caiohenrique12

Hi, I have same issue with Rails 6.1.4, Ruby 3.0. Any Progress?

00Masato avatar May 20 '22 04:05 00Masato

I updated the gem to 3.9.0 where they have fixed the issue https://github.com/deivid-rodriguez/pry-byebug/blob/master/lib/pry-byebug/control_d_handler.rb

but this version of gem is not compatible with latest version of pry as getting the error below

Bundler could not find compatible versions for gem "pry":
  In snapshot (Gemfile.lock):
    pry (= 0.14.1)

  In Gemfile:
    pry

    pry-byebug (~> 3.9.0) was resolved to 3.9.0, which depends on
      pry (~> 0.13.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

Just for info if you are using Rails 7 then remove these gems and use built in debugger https://guides.rubyonrails.org/debugging_rails_applications.html#entering-a-debugging-session

kzq avatar Jun 29 '22 10:06 kzq

This should be fixed now by the recent releases!

deivid-rodriguez avatar Aug 22 '22 08:08 deivid-rodriguez