pry-shell 0.5.0 → 0.5.1

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: 3c2ada13df84d73e1825a12b3b6f1d48323a1ee26b259d0d621954f992b5bcba
4
+ data.tar.gz: '07290249ca6c84a110288199d5c467cb01a239066ec6ca219cac2ad6abdcda1e'
5
5
  SHA512:
6
- metadata.gz: d534b80562457c6005d49be9551b59dcc26127d1cdace9426fe17d76aeb45cd4bf1ff784d6cd8d1de3ca90390c699f0835c7f17573f216310840ee6aa5df5313
7
- data.tar.gz: 0a82202c3e05b20767d063cb6537b687bf5eafc96a29928e6a51a92a95068a319c3251e5b58d0808639231caa86fbc4c8eb36f13daf8775176816e3ea119c967
6
+ metadata.gz: dfd6b5a61516dd27da717291944e550b8e6e15def4cd59ee21bd479f069f059c8d5e57047414fd6d36c51b81c8bcd691b39d8f2dc02fc595121381b6f7ad3349
7
+ data.tar.gz: 342f64a819c36580b331caf9bc67cc4407bace3531fb173c3d34f4bdfc25dab7a21cd9e8cb9803d91181a1db35652e5e48cabcb4a47c5cf74644ed39f6fbc65e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-shell (0.5.0)
4
+ pry-shell (0.5.1)
5
5
  pry (~> 0.13.0)
6
6
  tty-markdown
7
7
  tty-prompt
@@ -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)
@@ -31,7 +31,7 @@ GEM
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.29.0)
35
35
  rspec (3.10.0)
36
36
  rspec-core (~> 3.10.0)
37
37
  rspec-expectations (~> 3.10.0)
@@ -94,4 +94,4 @@ DEPENDENCIES
94
94
  rubocop (~> 1.7)
95
95
 
96
96
  BUNDLED WITH
97
- 2.2.16
97
+ 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.
@@ -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.5.1"
6
6
  end
7
7
  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.5.0
4
+ version: 0.5.1
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: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -122,7 +122,7 @@ 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
125
+ rubygems_version: 3.1.6
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Provides remote pry sessions.