Comments (7)
Could you make it configurable at least? This feature may be useful for those who use debugging features often, but there are lots of people who use pry just to eval code in a context. In our case one developer in a team needed debugging features, added pry-byebug to Gemfile, and now everyone else suffer from this behaviour. Thank you.
from pry-byebug.
Hi @rf- , I don't think it modifies the experience at all, it just changes a marker from one line to the next. It might surprise users, but once they enter a few commands and see everything works just like before, I don't see the problem. Plus, there's a bump in the major version number so that should be a "surprise reducer".
For people who want to use debugging features and step through the code, this commit saves them from having to enter a meaningless next
everytime they start debugging.
I'm very positive about keeping this, but I'm open for a discussion. 👍
from pry-byebug.
This is actually worse than I realized. It's not just the visual marker, it's actually stepping out of the context where the user placed the breakpoint. Look at this example:
From: /home/rfitz/xxxxx/lib/tasks/db.rake @ line 27 :
22: sql_dump.gsub!(/(CREATE TABLE `\w+` \(\n)(.*)(^\))/m) do |match|
23: binding.pry
24: end
25:
26: # Sort the schema_migrations inserts to reduce churn.
=> 27: migration_sql = sql_dump.slice!(/INSERT INTO schema_migrations.*/m)
28: migrations = migration_sql.split("\n").select(&:present?)
29: sorted_migrations = migrations.sort.join("\n\n")
30:
31: File.write(filename, sql_dump << sorted_migrations << "\n")
32: end
[1] pry(main)> match
NameError: undefined local variable or method `match' for main:Object
from (pry):1:in `block (3 levels) in <top (required)>'
[2] pry(main)>
This is breaking the most important feature of Pry, the ability to write binding.pry
and drop into a REPL in the context where you placed the binding.pry
statement. Please fix it.
from pry-byebug.
@rf- This was unintentional and it's a bug, thanks for finding out. I think I've fixed it in latest master. Could you please try?
from pry-byebug.
@rf- I'm going to close this for now. If you have further objections, feel free to reopen and continue the discussion.
from pry-byebug.
@deivid-rodriguez The fix improved things but the behaviour is still unexpected.
$ ruby breakpoint_test.rb [2.1.2]
From: /tmp/breakpoint_test.rb @ line 6 :
1: require 'pry'
2:
3: begin
4: 1/0
5: rescue ZeroDivisionError
=> 6: binding.pry # $! is ZeroDivisionError with a message of 'divided by 0'
7: end
8: 'huh?' # If this line didn't exist then the binding.pry acts like it wasn't called
2.1.2 (main):0 > $!
=> #<ZeroDivisionError: divided by 0>
2.1.2 (main):0 > exit
$ gem install pry-byebug [2.1.2]
Fetching: pry-byebug-2.0.0.gem (100%)
Successfully installed pry-byebug-2.0.0
1 gem installed
$ ruby breakpoint_test.rb [2.1.2]
From: /tmp/breakpoint_test.rb @ line 8 :
3: begin
4: 1/0
5: rescue ZeroDivisionError
6: binding.pry # $! is ZeroDivisionError with a message of 'divided by 0'
7: end
=> 8: 'huh?' # If this line didn't exist then the binding.pry acts like it wasn't called
2.1.2 (main):0 > $!
=> nil
from pry-byebug.
Read the linked issue, that's the current state of things.
from pry-byebug.
Related Issues (20)
- It's possible to start a REPL session passing a command? HOT 1
- Loading pry-byebug on Archlinux fails with "cannot load such file -- irb" HOT 1
- Newest version of Pry breaks pry-byebug HOT 15
- Pry Byebug specifies an older version of Pry HOT 1
- Deprecation warnings in Ruby 2.7 HOT 2
- Pry "next" alias does not work
- Any plans for a new release? HOT 4
- less: unrecognized option: X HOT 1
- PR proposition : Deprecated - Pry.config.control_d_handler HOT 6
- Repeated newlines in multi-line strings are ignored
- NameError: undefined local variable or method `text' for #<PryByebug::BreakCommand HOT 2
- New release? HOT 2
- Deprecation warnings Pry v 0.14.1 on Ruby v 3.1.1 HOT 1
- Relax restriction for byebug version HOT 5
- The version 3.10.0 breaks rails console HOT 8
- Build failure with ruby-pry-byebug version 3.9.0-1
- Run error using Ruby 3.2 HOT 1
- Deprecation on Ruby 3.2.2
- Compatibility Inquiry: pry-byebug 3.10.1 with Ruby 3.3.0
- Question: Is there a recommended way of requiring the gem for test but not CI?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pry-byebug.