pry-byebug-reloaded 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/byebug/processors/pry_remote_processor.rb +48 -0
- data/lib/pry-byebug/base.rb +3 -1
- data/lib/pry-byebug/commands/exit_all.rb +1 -0
- data/lib/pry-byebug/commands/finish.rb +1 -0
- data/lib/pry-byebug/pry_ext.rb +12 -2
- data/lib/pry-byebug/pry_remote_ext.rb +8 -9
- data/lib/pry-byebug/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfffbb2ef748ad7fe06cd24a45ea92c8fa856fcfe721750dc8d04562b68dc7b8
|
4
|
+
data.tar.gz: 4d55be7aae55a7b229afa6ef511a984e7465c3ba6cb0608a0981ed507e8f6bac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30e84211d6818a52fa650c93ae52d487410932e633e45e2f2b75284cca9531f564d4649ed00643a55777a4dbbd4f9e85facae97d451b1520ef9d1de9cce64980
|
7
|
+
data.tar.gz: cfd11763708b7279ec12443d5bb016467f822480a6e8878b83820de5540ebfd7163337a373c40baf0f3edd44b8145753f154832a9ed9827a24d2211a0101313a
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/core"
|
4
|
+
|
5
|
+
module Byebug
|
6
|
+
#
|
7
|
+
# Extends the PryProcessor to make it work with Pry-Remote
|
8
|
+
#
|
9
|
+
class PryRemoteProcessor < PryProcessor
|
10
|
+
def self.start
|
11
|
+
super
|
12
|
+
|
13
|
+
Byebug.current_context.step_out(5, true)
|
14
|
+
end
|
15
|
+
|
16
|
+
def resume_pry
|
17
|
+
new_binding = frame._binding
|
18
|
+
|
19
|
+
run do
|
20
|
+
return unless server
|
21
|
+
|
22
|
+
if defined?(@pry) && @pry
|
23
|
+
@pry.repl(new_binding)
|
24
|
+
else
|
25
|
+
@pry = Pry::REPL.start_without_pry_byebug(target: new_binding,
|
26
|
+
input: input,
|
27
|
+
output: output)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
rescue Errno::ECONNREFUSED
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def input
|
37
|
+
server.client.input_proxy
|
38
|
+
end
|
39
|
+
|
40
|
+
def output
|
41
|
+
server.client.output
|
42
|
+
end
|
43
|
+
|
44
|
+
def server
|
45
|
+
PryByebug.current_remote_server
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/pry-byebug/base.rb
CHANGED
@@ -7,7 +7,9 @@ require "pry-byebug/helpers/location"
|
|
7
7
|
#
|
8
8
|
module PryByebug
|
9
9
|
# Reference to currently running pry-remote server. Used by the processor.
|
10
|
-
|
10
|
+
class << self
|
11
|
+
attr_accessor :current_remote_server
|
12
|
+
end
|
11
13
|
|
12
14
|
module_function
|
13
15
|
|
data/lib/pry-byebug/pry_ext.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "byebug/processors/pry_processor"
|
4
|
+
require "byebug/processors/pry_remote_processor"
|
4
5
|
|
5
6
|
class << Pry::REPL
|
6
7
|
alias start_without_pry_byebug start
|
@@ -8,8 +9,13 @@ class << Pry::REPL
|
|
8
9
|
def start_with_pry_byebug(options = {})
|
9
10
|
target = options[:target]
|
10
11
|
|
11
|
-
if target.is_a?(Binding) && PryByebug.file_context?(target)
|
12
|
-
|
12
|
+
if target.is_a?(Binding) && PryByebug.file_context?(target) && !ENV["DISABLE_PRY"]
|
13
|
+
if run_remote?
|
14
|
+
Byebug::PryRemoteProcessor.start
|
15
|
+
return start_without_pry_byebug(options)
|
16
|
+
end
|
17
|
+
|
18
|
+
Byebug::PryProcessor.start
|
13
19
|
else
|
14
20
|
# No need for the tracer unless we have a file context to step through
|
15
21
|
start_without_pry_byebug(options)
|
@@ -17,4 +23,8 @@ class << Pry::REPL
|
|
17
23
|
end
|
18
24
|
|
19
25
|
alias start start_with_pry_byebug
|
26
|
+
|
27
|
+
def run_remote?
|
28
|
+
PryByebug.current_remote_server
|
29
|
+
end
|
20
30
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "pry-remote"
|
3
|
+
require "pry-remote-reloaded"
|
4
4
|
|
5
|
-
module
|
5
|
+
module PryRemoteReloaded
|
6
6
|
#
|
7
7
|
# Overrides PryRemote::Server
|
8
8
|
#
|
@@ -11,28 +11,27 @@ module PryRemote
|
|
11
11
|
# Override the call to Pry.start to save off current Server, and not
|
12
12
|
# teardown the server right after Pry.start finishes.
|
13
13
|
#
|
14
|
+
alias original_run run
|
14
15
|
def run
|
15
16
|
raise("Already running a pry-remote session!") if
|
16
17
|
PryByebug.current_remote_server
|
17
18
|
|
18
19
|
PryByebug.current_remote_server = self
|
19
20
|
|
20
|
-
|
21
|
-
Pry.start @object, input: client.input_proxy, output: client.output
|
21
|
+
catch(:breakout_nav) { original_run }
|
22
22
|
end
|
23
23
|
|
24
24
|
#
|
25
25
|
# Override to reset our saved global current server session.
|
26
26
|
#
|
27
|
-
alias
|
28
|
-
def
|
29
|
-
|
27
|
+
alias original_teardown teardown
|
28
|
+
def teardown
|
29
|
+
original_teardown
|
30
30
|
|
31
|
-
|
31
|
+
return if @torn
|
32
32
|
PryByebug.current_remote_server = nil
|
33
33
|
@torn = true
|
34
34
|
end
|
35
|
-
alias teardown teardown_with_pry_byebug
|
36
35
|
end
|
37
36
|
end
|
38
37
|
|
data/lib/pry-byebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-byebug-reloaded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.
|
4
|
+
version: 3.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodríguez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-12-
|
12
|
+
date: 2023-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: byebug
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- LICENSE
|
60
60
|
- README.md
|
61
61
|
- lib/byebug/processors/pry_processor.rb
|
62
|
+
- lib/byebug/processors/pry_remote_processor.rb
|
62
63
|
- lib/pry-byebug.rb
|
63
64
|
- lib/pry-byebug/base.rb
|
64
65
|
- lib/pry-byebug/cli.rb
|