pry-shell 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7486f16eeffbc03edfea35c07db4c82910cb71ef3f972a7291ff6e4035f6e1ad
4
- data.tar.gz: 797f2e6ce033b7bdf2c130be6405b5e3c5dacf46c87e5519a7ae2b08fecd6477
3
+ metadata.gz: 389a33c7fd18d6c524fed6336f9f542ac0a40aa3c30480fe4d77e9f02da2779b
4
+ data.tar.gz: f1f6112d6623eacf91a50c3858805e4ec36181c55bbbe482829ea1d5884b0515
5
5
  SHA512:
6
- metadata.gz: f4930f76efa7722317634e5e2d4c256549b2e9c2b83d6d19446409867c750c5cfe1192cc4c9f80d32990892e627201aa81f426aac7c0caf9b42d598981a830a1
7
- data.tar.gz: 9698c6433c42e612cb70fd914bad02c12964b59f9098536b85d64ddb32d6e6edd9fc1b97355e1ea0aa46cc5452fcc84c650a5848701da43fc2189d01e16a2f19
6
+ metadata.gz: a58253f83fd57ac0c7638a91a622aa0eef30efae0e17cb174d5b829c63555225656425a5e01320b5d126a982315e2185066f4f4489f7f058d5222f6c98c8413e
7
+ data.tar.gz: 37228f46b4b8eacf2c034817c46952120a65cc71cdf1a6a3b700053c895daba00ca47d6e67ecb5316c56798b8e93918616ffeab06d840429551311ca0da83c7c
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-shell (0.6.0)
4
+ pry-shell (0.6.2)
5
5
  pry (>= 0.13.0)
6
- tty-markdown
6
+ tty-markdown (= 0.7.1)
7
7
  tty-prompt
8
8
 
9
9
  GEM
@@ -11,21 +11,29 @@ begin
11
11
  Byebug.start
12
12
  Setting[:autolist] = false
13
13
  Context.processor = self
14
- Byebug.current_context.step_out(7, true)
14
+ Byebug.current_context.step_out(8, true)
15
15
  at_exit { teardown! }
16
16
  end
17
17
 
18
- private
19
-
20
18
  def teardown!
21
19
  Pry::Shell.remove_active_connection!
22
20
  Pry::Shell.clear_shell_options!
23
21
  end
24
22
  end
25
23
 
24
+ def initialize(...)
25
+ super
26
+
27
+ # Set the interface for byebug outputs
28
+ @interface = Byebug::RemoteInterface.new(Pry::Shell.active_shell_options[:output])
29
+ end
30
+
26
31
  def resume_pry
27
32
  run do
28
33
  pry_started? ? start_new_pry_repl : start_new_pry_session
34
+
35
+ # Close shell session after repl loop
36
+ self.class.teardown!
29
37
  end
30
38
  rescue DRb::DRbConnError
31
39
  puts "DRb connection failed!"
@@ -38,7 +46,9 @@ begin
38
46
  end
39
47
 
40
48
  def start_new_pry_session
41
- @pry = Pry.start_without_pry_byebug(frame._binding, Pry::Shell.active_shell_options)
49
+ repl_options = Pry::Shell.active_shell_options.merge(target: frame._binding)
50
+
51
+ @pry = Pry::Shell::Repl.start_without_pry_byebug(repl_options)
42
52
  end
43
53
 
44
54
  def start_new_pry_repl
@@ -51,17 +61,17 @@ begin
51
61
  class Shell
52
62
  module Patches
53
63
  module PryByebug
54
- def start_with_pry_byebug(target = nil, options = {})
55
- return start_with_pry_shell(target) if Shell.active_shell_options
64
+ def start_with_pry_byebug(options = {})
65
+ return start_with_pry_shell(options) if Shell.active_shell_options
56
66
 
57
67
  super
58
68
  end
59
69
 
60
- def start_with_pry_shell(target)
70
+ def start_with_pry_shell(options)
61
71
  if Shell.active_shell_options[:enable_byebug?]
62
72
  ::Byebug::PryShellProcessor.start
63
73
  else
64
- start_without_pry_byebug(target, Shell.active_shell_options)
74
+ start_without_pry_byebug(options)
65
75
  end
66
76
  end
67
77
  end
@@ -72,15 +82,15 @@ begin
72
82
 
73
83
  # We should step out one more frame as we are
74
84
  # prepending another module to the hierarchy
75
- ::Byebug.current_context.step_out(5, true)
85
+ ::Byebug.current_context.step_out(6, true)
76
86
  end
77
87
  end
78
88
  end
79
89
  end
80
90
  end
81
91
 
82
- Pry.singleton_class.prepend(Pry::Shell::Patches::PryByebug)
83
- Pry.singleton_class.alias_method(:start, :start_with_pry_byebug)
92
+ Pry::REPL.singleton_class.prepend(Pry::Shell::Patches::PryByebug)
93
+ Pry::REPL.singleton_class.alias_method(:start, :start_with_pry_byebug)
84
94
 
85
95
  Byebug::PryProcessor.singleton_class.prepend(Pry::Shell::Patches::PryProcessor)
86
96
  rescue LoadError # rubocop:disable Lint/SuppressedException
@@ -5,7 +5,9 @@ class Pry
5
5
  module Patches
6
6
  module RackTimeout
7
7
  def initialize(&on_timeout)
8
- @on_timeout = -> (thread) { Shell.active_shell_options(thread: thread) || on_timeout || ON_TIMEOUT }
8
+ timeout_handler = on_timeout || ON_TIMEOUT
9
+
10
+ @on_timeout = -> (thread) { Shell.active_shell_options(thread: thread) || timeout_handler.call(thread) } # Do not raise timeout error if the shell session is active
9
11
  @scheduler = Rack::Timeout::Scheduler.singleton
10
12
  end
11
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Pry
4
4
  class Shell
5
- VERSION = "0.6.0"
5
+ VERSION = "0.6.2"
6
6
  end
7
7
  end
data/pry-shell.gemspec CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
 
29
29
  spec.add_dependency "pry", ">= 0.13.0"
30
- spec.add_dependency "tty-markdown"
30
+ spec.add_dependency "tty-markdown", '0.7.1'
31
31
  spec.add_dependency "tty-prompt"
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-25 00:00:00.000000000 Z
11
+ date: 2023-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: tty-markdown
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.7.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.7.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tty-prompt
43
43
  requirement: !ruby/object:Gem::Requirement