pry-byebug 3.7.0 → 3.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -1
- data/README.md +20 -14
- data/lib/byebug/processors/pry_processor.rb +2 -10
- data/lib/pry/byebug/breakpoints.rb +1 -2
- data/lib/pry-byebug/base.rb +3 -1
- data/lib/pry-byebug/commands/breakpoint.rb +2 -0
- data/lib/pry-byebug/commands/continue.rb +2 -0
- data/lib/pry-byebug/commands/exit_all.rb +2 -0
- data/lib/pry-byebug/control_d_handler.rb +2 -2
- data/lib/pry-byebug/helpers/breakpoints.rb +5 -13
- data/lib/pry-byebug/helpers/location.rb +24 -0
- data/lib/pry-byebug/helpers/navigation.rb +2 -2
- data/lib/pry-byebug/pry_ext.rb +3 -8
- data/lib/pry-byebug/version.rb +1 -1
- metadata +18 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5cd1dcba0a316d9abf2842900170c4adffc517777c67916bc7f49744669c1cc
|
4
|
+
data.tar.gz: c2eb031ee7d4998df0bc1f0c2a3d8af303cd0b2956bfbafdd1832ed799603a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 050f9701d0c5286e7a7b18ee3e7aafda441fc0a2f72e55c4c8828e08eb68362d54906e99e6d43ef60e469ebb959d6bc6e54ddd097b8e38922560d6026eb612eb
|
7
|
+
data.tar.gz: 3cb6fcb16a10b239ae30b90ec8e71d9c90c1960b14c8b56a89733bb810e15181a9914da34f66457381c574d74ffb601a1a35940aa0ebc8a2f0c185ec51cfe9d6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,41 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 3.10.0 (2022-08-15)
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
* Support for pry 0.14 (#346, #386). NOTE: pry-byebug now needs to be explicitly required from `~/.pryrc` since plugin autoloading has been removed from Pry.
|
10
|
+
|
11
|
+
### Removed
|
12
|
+
|
13
|
+
* Support for Ruby 2.4, 2.5, and 2.6. Pry-byebug no longer installs on these platforms (#380).
|
14
|
+
|
15
|
+
## 3.9.0 (2020-03-21)
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
* Dependency on pry being too loose. Now breaking minor releases of pry won't affect pry-byebug users (#289).
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
* Support for pry 0.13.0 (#266).
|
24
|
+
|
25
|
+
### Removed
|
26
|
+
|
27
|
+
* Support for pry older than 0.13.0 (#289).
|
28
|
+
|
29
|
+
## 3.8.0 (2020-01-22)
|
30
|
+
|
31
|
+
### Fixed
|
32
|
+
|
33
|
+
* Use `Binding#source_location` instead of evaluating `__FILE__` to avoid
|
34
|
+
warnings on Ruby 2.7 and on Ruby 2.6 in verbose mode (#221).
|
35
|
+
|
36
|
+
### Removed
|
37
|
+
|
38
|
+
* Support for Ruby 2.3. Pry-byebug no longer installs on this platform.
|
39
|
+
|
5
40
|
## 3.7.0 (2019-02-21)
|
6
41
|
|
7
42
|
* Byebug 11 compatibility, with ruby 2.6 support.
|
@@ -16,7 +51,7 @@
|
|
16
51
|
|
17
52
|
### Fixed
|
18
53
|
|
19
|
-
* Allow other threads like Pry
|
54
|
+
* Allow other threads like Pry (#142).
|
20
55
|
|
21
56
|
## 3.5.0 (2017-08-23)
|
22
57
|
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# pry-byebug
|
2
2
|
|
3
3
|
[![Version][VersionBadge]][VersionURL]
|
4
|
-
[![Build][
|
4
|
+
[![Build][CIBadge]][CIURL]
|
5
5
|
[![Inline docs][InchCIBadge]][InchCIURL]
|
6
|
-
[![Coverage][CoverageBadge]][CoverageURL]
|
7
6
|
|
8
7
|
Adds step-by-step debugging and stack navigation capabilities to [pry] using
|
9
8
|
[byebug].
|
@@ -23,7 +22,7 @@ puts 'Goodbye World' # Run 'next' in the console to move here.
|
|
23
22
|
|
24
23
|
## Requirements
|
25
24
|
|
26
|
-
MRI 2.
|
25
|
+
MRI 2.4.0 or higher.
|
27
26
|
|
28
27
|
## Installation
|
29
28
|
|
@@ -96,7 +95,7 @@ your `~/.pryrc` file:
|
|
96
95
|
```ruby
|
97
96
|
# Hit Enter to repeat last command
|
98
97
|
Pry::Commands.command /^$/, "repeat last command" do
|
99
|
-
|
98
|
+
pry_instance.run_command Pry.history.to_a.last
|
100
99
|
end
|
101
100
|
```
|
102
101
|
|
@@ -149,14 +148,23 @@ mentioned here if they are present in your Gemfile.
|
|
149
148
|
|
150
149
|
See [Getting Started with Development](CONTRIBUTING.md).
|
151
150
|
|
152
|
-
|
153
|
-
[Liberapay][liberapay.com].
|
151
|
+
## Funding
|
154
152
|
|
155
|
-
|
153
|
+
Subscribe to [Tidelift] to ensure pry-byebug stays actively maintained, and at
|
154
|
+
the same time get licensing assurances and timely security notifications for
|
155
|
+
your open source dependencies.
|
156
156
|
|
157
|
-
[
|
158
|
-
|
159
|
-
[
|
157
|
+
You can also help `pry-byebug` by leaving a small (or big) tip through [Liberapay].
|
158
|
+
|
159
|
+
[Tidelift]: https://tidelift.com/subscription/pkg/rubygems-pry-byebug?utm_source=rubygems-pry-byebug&utm_medium=referral&utm_campaign=readme
|
160
|
+
[Liberapay]: https://liberapay.com/pry-byebug/donate
|
161
|
+
|
162
|
+
## Security contact information
|
163
|
+
|
164
|
+
Please use the Tidelift security contact to [report a security vulnerability].
|
165
|
+
Tidelift will coordinate the fix and disclosure.
|
166
|
+
|
167
|
+
[report a security vulnerability]: https://tidelift.com/security
|
160
168
|
|
161
169
|
## Credits
|
162
170
|
|
@@ -175,9 +183,7 @@ Patches and bug reports are welcome.
|
|
175
183
|
|
176
184
|
[VersionBadge]: https://badge.fury.io/rb/pry-byebug.svg
|
177
185
|
[VersionURL]: http://badge.fury.io/rb/pry-byebug
|
178
|
-
[
|
179
|
-
[
|
186
|
+
[CIBadge]: https://github.com/deivid-rodriguez/pry-byebug/workflows/ubuntu/badge.svg?branch=master
|
187
|
+
[CIURL]: https://github.com/deivid-rodriguez/pry-byebug/actions?query=workflow%3Aubuntu
|
180
188
|
[InchCIBadge]: http://inch-ci.org/github/deivid-rodriguez/pry-byebug.svg?branch=master
|
181
189
|
[InchCIURL]: http://inch-ci.org/github/deivid-rodriguez/pry-byebug
|
182
|
-
[CoverageBadge]: https://img.shields.io/codeclimate/coverage/github/deivid-rodriguez/pry-byebug.svg
|
183
|
-
[CoverageURL]: https://codeclimate.com/github/deivid-rodriguez/pry-byebug
|
@@ -17,7 +17,7 @@ module Byebug
|
|
17
17
|
Byebug.start
|
18
18
|
Setting[:autolist] = false
|
19
19
|
Context.processor = self
|
20
|
-
Byebug.current_context.step_out(
|
20
|
+
Byebug.current_context.step_out(5, true)
|
21
21
|
end
|
22
22
|
|
23
23
|
#
|
@@ -72,14 +72,6 @@ module Byebug
|
|
72
72
|
resume_pry
|
73
73
|
end
|
74
74
|
|
75
|
-
#
|
76
|
-
# Called when the debugger wants to stop right before the end of a class
|
77
|
-
# definition
|
78
|
-
#
|
79
|
-
def at_end
|
80
|
-
resume_pry
|
81
|
-
end
|
82
|
-
|
83
75
|
#
|
84
76
|
# Called when a breakpoint is hit. Note that `at_line`` is called
|
85
77
|
# inmediately after with the context's `stop_reason == :breakpoint`, so we
|
@@ -114,7 +106,7 @@ module Byebug
|
|
114
106
|
if defined?(@pry) && @pry
|
115
107
|
@pry.repl(new_binding)
|
116
108
|
else
|
117
|
-
@pry = Pry.start_without_pry_byebug(new_binding)
|
109
|
+
@pry = Pry::REPL.start_without_pry_byebug(target: new_binding)
|
118
110
|
end
|
119
111
|
end
|
120
112
|
end
|
@@ -88,7 +88,6 @@ class Pry
|
|
88
88
|
#
|
89
89
|
def delete(id)
|
90
90
|
deleted =
|
91
|
-
::Byebug.started? &&
|
92
91
|
::Byebug::Breakpoint.remove(id) &&
|
93
92
|
breakpoints.delete(find_by_id(id))
|
94
93
|
|
@@ -100,7 +99,7 @@ class Pry
|
|
100
99
|
#
|
101
100
|
def delete_all
|
102
101
|
@breakpoints = []
|
103
|
-
::Byebug.breakpoints.clear
|
102
|
+
::Byebug.breakpoints.clear
|
104
103
|
end
|
105
104
|
|
106
105
|
#
|
data/lib/pry-byebug/base.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "pry-byebug/helpers/location"
|
4
|
+
|
3
5
|
#
|
4
6
|
# Main container module for Pry-Byebug functionality
|
5
7
|
#
|
@@ -13,7 +15,7 @@ module PryByebug
|
|
13
15
|
# Checks that a target binding is in a local file context.
|
14
16
|
#
|
15
17
|
def file_context?(target)
|
16
|
-
file =
|
18
|
+
file = Helpers::Location.current_file(target)
|
17
19
|
file == Pry.eval_path || !Pry::Helpers::BaseHelpers.not_a_real_file?(file)
|
18
20
|
end
|
19
21
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "pry/byebug/breakpoints"
|
4
4
|
require "pry-byebug/helpers/breakpoints"
|
5
|
+
require "pry-byebug/helpers/location"
|
5
6
|
require "pry-byebug/helpers/multiline"
|
6
7
|
|
7
8
|
module PryByebug
|
@@ -10,6 +11,7 @@ module PryByebug
|
|
10
11
|
#
|
11
12
|
class BreakCommand < Pry::ClassCommand
|
12
13
|
include Helpers::Breakpoints
|
14
|
+
include Helpers::Location
|
13
15
|
include Helpers::Multiline
|
14
16
|
|
15
17
|
match "break"
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "pry-byebug/helpers/navigation"
|
4
4
|
require "pry-byebug/helpers/breakpoints"
|
5
|
+
require "pry-byebug/helpers/location"
|
5
6
|
|
6
7
|
module PryByebug
|
7
8
|
#
|
@@ -10,6 +11,7 @@ module PryByebug
|
|
10
11
|
class ContinueCommand < Pry::ClassCommand
|
11
12
|
include Helpers::Navigation
|
12
13
|
include Helpers::Breakpoints
|
14
|
+
include Helpers::Location
|
13
15
|
|
14
16
|
match "continue"
|
15
17
|
group "Byebug"
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
original_handler = Pry.config.control_d_handler
|
4
4
|
|
5
|
-
Pry.config.control_d_handler = proc do |
|
5
|
+
Pry.config.control_d_handler = proc do |pry_instance|
|
6
6
|
Byebug.stop if Byebug.stoppable?
|
7
7
|
|
8
|
-
original_handler.call(
|
8
|
+
original_handler.call(pry_instance)
|
9
9
|
end
|
@@ -15,19 +15,11 @@ module PryByebug
|
|
15
15
|
Pry::Byebug::Breakpoints
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
19
|
-
# Current file in the target binding. Used as the default breakpoint
|
20
|
-
# location.
|
21
|
-
#
|
22
|
-
def current_file
|
23
|
-
target.eval("__FILE__")
|
24
|
-
end
|
25
|
-
|
26
18
|
#
|
27
19
|
# Prints a message with bold font.
|
28
20
|
#
|
29
21
|
def bold_puts(msg)
|
30
|
-
output.puts(
|
22
|
+
output.puts(bold(msg))
|
31
23
|
end
|
32
24
|
|
33
25
|
#
|
@@ -40,14 +32,14 @@ module PryByebug
|
|
40
32
|
status = breakpoint.enabled? ? "Enabled" : "Disabled"
|
41
33
|
code = breakpoint.source_code.with_line_numbers.to_s
|
42
34
|
condition = if breakpoint.expr
|
43
|
-
"#{
|
35
|
+
"#{bold('Condition:')} #{breakpoint.expr}\n"
|
44
36
|
else
|
45
37
|
""
|
46
38
|
end
|
47
39
|
|
48
40
|
output.puts <<-BREAKPOINT.gsub(/ {8}/, "")
|
49
41
|
|
50
|
-
#{
|
42
|
+
#{bold(header)} #{breakpoint} (#{status}) #{condition}
|
51
43
|
|
52
44
|
#{code}
|
53
45
|
|
@@ -73,8 +65,8 @@ module PryByebug
|
|
73
65
|
|
74
66
|
output.puts <<-BREAKPOINTS.gsub(/ {8}/, "")
|
75
67
|
|
76
|
-
#{
|
77
|
-
#{
|
68
|
+
#{bold(header)}
|
69
|
+
#{bold('-' * header.size)}
|
78
70
|
|
79
71
|
BREAKPOINTS
|
80
72
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PryByebug
|
4
|
+
module Helpers
|
5
|
+
#
|
6
|
+
# Compatibility helper to handle source location
|
7
|
+
#
|
8
|
+
module Location
|
9
|
+
module_function
|
10
|
+
|
11
|
+
#
|
12
|
+
# Current file in the target binding. Used as the default breakpoint
|
13
|
+
# location.
|
14
|
+
#
|
15
|
+
def current_file(source = target)
|
16
|
+
# Guard clause for Ruby >= 2.6 providing now Binding#source_location ...
|
17
|
+
return source.source_location[0] if source.respond_to?(:source_location)
|
18
|
+
|
19
|
+
# ... to avoid warning: 'eval may not return location in binding'
|
20
|
+
source.eval("__FILE__")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -10,9 +10,9 @@ module PryByebug
|
|
10
10
|
# Breaks out of the REPL loop and signals tracer
|
11
11
|
#
|
12
12
|
def breakout_navigation(action, options = {})
|
13
|
-
|
13
|
+
pry_instance.binding_stack.clear
|
14
14
|
|
15
|
-
throw :breakout_nav, action: action, options: options, pry:
|
15
|
+
throw :breakout_nav, action: action, options: options, pry: pry_instance
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/pry-byebug/pry_ext.rb
CHANGED
@@ -2,16 +2,11 @@
|
|
2
2
|
|
3
3
|
require "byebug/processors/pry_processor"
|
4
4
|
|
5
|
-
class << Pry
|
5
|
+
class << Pry::REPL
|
6
6
|
alias start_without_pry_byebug start
|
7
7
|
|
8
|
-
def start_with_pry_byebug(
|
9
|
-
|
10
|
-
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
|
11
|
-
else
|
12
|
-
# No need for the tracer unless we have a file context to step through
|
13
|
-
start_without_pry_byebug(target, options)
|
14
|
-
end
|
8
|
+
def start_with_pry_byebug(_ = {})
|
9
|
+
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
|
15
10
|
end
|
16
11
|
|
17
12
|
alias start start_with_pry_byebug
|
data/lib/pry-byebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodríguez
|
8
8
|
- Gopal Patel
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: byebug
|
@@ -29,16 +29,22 @@ dependencies:
|
|
29
29
|
name: pry
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.13'
|
35
|
+
- - "<"
|
33
36
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0.
|
37
|
+
version: '0.15'
|
35
38
|
type: :runtime
|
36
39
|
prerelease: false
|
37
40
|
version_requirements: !ruby/object:Gem::Requirement
|
38
41
|
requirements:
|
39
|
-
- - "
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0.13'
|
45
|
+
- - "<"
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
47
|
+
version: '0.15'
|
42
48
|
description: |-
|
43
49
|
Combine 'pry' with 'byebug'. Adds 'step', 'next', 'finish',
|
44
50
|
'continue' and 'break' commands to control execution.
|
@@ -69,6 +75,7 @@ files:
|
|
69
75
|
- lib/pry-byebug/commands/up.rb
|
70
76
|
- lib/pry-byebug/control_d_handler.rb
|
71
77
|
- lib/pry-byebug/helpers/breakpoints.rb
|
78
|
+
- lib/pry-byebug/helpers/location.rb
|
72
79
|
- lib/pry-byebug/helpers/multiline.rb
|
73
80
|
- lib/pry-byebug/helpers/navigation.rb
|
74
81
|
- lib/pry-byebug/pry_ext.rb
|
@@ -79,7 +86,7 @@ homepage: https://github.com/deivid-rodriguez/pry-byebug
|
|
79
86
|
licenses:
|
80
87
|
- MIT
|
81
88
|
metadata: {}
|
82
|
-
post_install_message:
|
89
|
+
post_install_message:
|
83
90
|
rdoc_options: []
|
84
91
|
require_paths:
|
85
92
|
- lib
|
@@ -87,15 +94,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
94
|
requirements:
|
88
95
|
- - ">="
|
89
96
|
- !ruby/object:Gem::Version
|
90
|
-
version: 2.
|
97
|
+
version: 2.7.0
|
91
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
99
|
requirements:
|
93
100
|
- - ">="
|
94
101
|
- !ruby/object:Gem::Version
|
95
102
|
version: '0'
|
96
103
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
98
|
-
signing_key:
|
104
|
+
rubygems_version: 3.3.20
|
105
|
+
signing_key:
|
99
106
|
specification_version: 4
|
100
107
|
summary: Fast debugging with Pry.
|
101
108
|
test_files: []
|