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 +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +22 -2
- data/lib/pry/shell/io/input.rb +10 -0
- data/lib/pry/shell/registry.rb +4 -3
- data/lib/pry/shell/session.rb +5 -1
- data/lib/pry/shell/ui/menu.rb +9 -0
- data/lib/pry/shell/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c2ada13df84d73e1825a12b3b6f1d48323a1ee26b259d0d621954f992b5bcba
|
4
|
+
data.tar.gz: '07290249ca6c84a110288199d5c467cb01a239066ec6ca219cac2ad6abdcda1e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
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.
|
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.
|
data/lib/pry/shell/io/input.rb
CHANGED
@@ -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
|
data/lib/pry/shell/registry.rb
CHANGED
data/lib/pry/shell/session.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/pry/shell/ui/menu.rb
CHANGED
@@ -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)
|
data/lib/pry/shell/version.rb
CHANGED
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.
|
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:
|
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.
|
125
|
+
rubygems_version: 3.1.6
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Provides remote pry sessions.
|