pry-shell 0.5.0 → 0.6.0

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: 4b7c98d15684726ac960299f6b91bce6e5baae12c6c72d97c211150647026fce
4
- data.tar.gz: 6b39ad64506fdc162e6f19220067aaad25a44e431d8f93533a4ae6a0f1f90b3a
3
+ metadata.gz: 7486f16eeffbc03edfea35c07db4c82910cb71ef3f972a7291ff6e4035f6e1ad
4
+ data.tar.gz: 797f2e6ce033b7bdf2c130be6405b5e3c5dacf46c87e5519a7ae2b08fecd6477
5
5
  SHA512:
6
- metadata.gz: d534b80562457c6005d49be9551b59dcc26127d1cdace9426fe17d76aeb45cd4bf1ff784d6cd8d1de3ca90390c699f0835c7f17573f216310840ee6aa5df5313
7
- data.tar.gz: 0a82202c3e05b20767d063cb6537b687bf5eafc96a29928e6a51a92a95068a319c3251e5b58d0808639231caa86fbc4c8eb36f13daf8775176816e3ea119c967
6
+ metadata.gz: f4930f76efa7722317634e5e2d4c256549b2e9c2b83d6d19446409867c750c5cfe1192cc4c9f80d32990892e627201aa81f426aac7c0caf9b42d598981a830a1
7
+ data.tar.gz: 9698c6433c42e612cb70fd914bad02c12964b59f9098536b85d64ddb32d6e6edd9fc1b97355e1ea0aa46cc5452fcc84c650a5848701da43fc2189d01e16a2f19
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ .tool-versions
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-shell (0.5.0)
5
- pry (~> 0.13.0)
4
+ pry-shell (0.6.0)
5
+ pry (>= 0.13.0)
6
6
  tty-markdown
7
7
  tty-prompt
8
8
 
@@ -13,7 +13,7 @@ GEM
13
13
  byebug (11.1.3)
14
14
  coderay (1.1.3)
15
15
  diff-lcs (1.4.4)
16
- kramdown (2.3.1)
16
+ kramdown (2.4.0)
17
17
  rexml
18
18
  method_source (1.0.0)
19
19
  parallel (1.20.1)
@@ -21,17 +21,17 @@ GEM
21
21
  ast (~> 2.4.1)
22
22
  pastel (0.8.0)
23
23
  tty-color (~> 0.5)
24
- pry (0.13.1)
24
+ pry (0.14.2)
25
25
  coderay (~> 1.1)
26
26
  method_source (~> 1.0)
27
- pry-byebug (3.9.0)
27
+ pry-byebug (3.10.1)
28
28
  byebug (~> 11.0)
29
- pry (~> 0.13.0)
29
+ pry (>= 0.13, < 0.15)
30
30
  rainbow (3.0.0)
31
31
  rake (13.0.3)
32
32
  regexp_parser (2.1.1)
33
33
  rexml (3.2.5)
34
- rouge (3.26.0)
34
+ rouge (3.30.0)
35
35
  rspec (3.10.0)
36
36
  rspec-core (~> 3.10.0)
37
37
  rspec-expectations (~> 3.10.0)
@@ -64,7 +64,7 @@ GEM
64
64
  strings-ansi (0.2.0)
65
65
  tty-color (0.6.0)
66
66
  tty-cursor (0.7.1)
67
- tty-markdown (0.7.0)
67
+ tty-markdown (0.7.1)
68
68
  kramdown (>= 1.16.2, < 3.0)
69
69
  pastel (~> 0.8)
70
70
  rouge (~> 3.14)
@@ -84,6 +84,7 @@ GEM
84
84
  wisper (2.0.1)
85
85
 
86
86
  PLATFORMS
87
+ arm64-darwin-21
87
88
  x86_64-darwin-19
88
89
 
89
90
  DEPENDENCIES
@@ -94,4 +95,4 @@ DEPENDENCIES
94
95
  rubocop (~> 1.7)
95
96
 
96
97
  BUNDLED WITH
97
- 2.2.16
98
+ 2.3.15
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pry/shell`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
@@ -24,6 +22,28 @@ Or install it yourself as:
24
22
 
25
23
  Here's a [video showing how to use pry-shell](https://www.youtube.com/watch?v=Lzs_PL_BySo).
26
24
 
25
+ ### Start the shell
26
+
27
+ $ pry-shell
28
+
29
+ ### Add breakpoints
30
+
31
+ Include this snippet in the code line you are interested:
32
+
33
+ ```ruby
34
+ binding.pry_shell
35
+ ```
36
+
37
+ PryShell will enable [Byebug](https://github.com/deivid-rodriguez/byebug) by default if the `pry-byebug` gem has already been installed. In case if you want to disable byebug, you can set the `with_byebug` option as false, like so;
38
+
39
+ ```ruby
40
+ binding.pry_shell(with_byebug: false)
41
+ ```
42
+
43
+ ### Get access to the Pry session
44
+
45
+ Start the shell, add a breakpoint and make your program hit the desired code section. Afterwards, choose "Available sessions" from the shell main menu and hit "Enter". Then select your desired pry session and hit "Enter".
46
+
27
47
  ## Development
28
48
 
29
49
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/exe/pry-shell CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
3
  require "pry/shell"
5
4
  require "pry/shell/cli"
6
5
 
@@ -7,11 +7,21 @@ class Pry
7
7
  module IO
8
8
  class Input < Base
9
9
  def readline(prompt)
10
+ drb_thread
11
+
10
12
  wait_until_current
11
13
 
12
14
  string = object.readline(prompt, true)
13
15
 
14
16
  Command.execute(client, string)
17
+ rescue
18
+ drb_thread.kill
19
+
20
+ nil
21
+ end
22
+
23
+ def drb_thread
24
+ @drb_thread ||= Thread.current
15
25
  end
16
26
 
17
27
  # Assigns the `completion_proc` given by the
@@ -44,11 +44,12 @@ class Pry
44
44
  end
45
45
 
46
46
  def remove(client)
47
- @current = nil
48
-
49
47
  @clients.delete(client.id)
50
48
 
51
- UI.restart!
49
+ if client.current?
50
+ @current = nil
51
+ UI.restart!
52
+ end
52
53
  end
53
54
  end
54
55
  end
@@ -37,7 +37,11 @@ class Pry
37
37
  # to setup the Byebug.
38
38
  # We are clearing this options in `PryShellProcessor` to ensure
39
39
  # they do not leak.
40
- Shell.clear_shell_options! unless enable_byebug?
40
+ unless enable_byebug?
41
+ pry_options[:remove_connection].call
42
+
43
+ Shell.clear_shell_options!
44
+ end
41
45
  end
42
46
 
43
47
  private
@@ -20,6 +20,15 @@ class Pry
20
20
 
21
21
  class << self
22
22
  def draw_content
23
+ prompt.on(:keypress) do |event|
24
+ if event.value == "j"
25
+ prompt.trigger(:keydown)
26
+ end
27
+
28
+ if event.value == "k"
29
+ prompt.trigger(:keyup)
30
+ end
31
+ end
23
32
  selection = prompt.select("Select a menu item", ITEMS)
24
33
 
25
34
  switch_to(selection)
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Pry
4
4
  class Shell
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
data/pry-shell.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "pry", "~> 0.13.0"
29
+ spec.add_dependency "pry", ">= 0.13.0"
30
30
  spec.add_dependency "tty-markdown"
31
31
  spec.add_dependency "tty-prompt"
32
32
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.0
27
27
  - !ruby/object:Gem::Dependency
@@ -107,7 +107,7 @@ licenses:
107
107
  metadata:
108
108
  homepage_uri: https://github.com/meinac/pry-shell
109
109
  source_code_uri: https://github.com/meinac/pry-shell
110
- post_install_message:
110
+ post_install_message:
111
111
  rdoc_options: []
112
112
  require_paths:
113
113
  - lib
@@ -122,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.0.8
126
- signing_key:
125
+ rubygems_version: 3.3.26
126
+ signing_key:
127
127
  specification_version: 4
128
128
  summary: Provides remote pry sessions.
129
129
  test_files: []