pryx 0.8.7 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -35
- data/bin/irbx +4 -0
- data/bin/pryx +1 -1
- data/lib/pryx/ap_hack.rb +1 -0
- data/lib/pryx/common_plugins.rb +1 -10
- data/lib/pryx/irb_hack.rb +1 -16
- data/lib/pryx/looksee_hack.rb +2 -6
- data/lib/pryx/pry_hack.rb +2 -0
- data/lib/pryx/pry_plugins.rb +7 -3
- data/lib/pryx/version.rb +1 -1
- data/lib/pryx.rb +0 -1
- data/lib/pryx_cli.rb +1 -6
- metadata +15 -16
- data/lib/pryx_irb.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2feb9ad3cf24d155fd61504945371bc47c1c31b111249e7f387624bcb76a2cad
|
4
|
+
data.tar.gz: f4a8f822b8843a546400e0a3418248b5bcd581c54236775b42f58bfb61218015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 519a408c47c2ee75c0c37b3bb5cd0bf184a60c8b8eeb3bc33aedc085c0ed63f22985c2971584b85040ecb9e965d720364eff0b73d1434f1cd3c0c0b60a5adb20
|
7
|
+
data.tar.gz: b4e95675496e2a12c58bdeb7e0a3b46115d1f16258316158620bb1c9ff7b03befc6551b887aa708a8463d96cd0828614bcef1817c68919a3e186f8b15114fec6
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Instead, install it directly via RubyGems
|
|
10
10
|
|
11
11
|
$ gem install pryx
|
12
12
|
|
13
|
-
Then
|
13
|
+
Then user can use pryx cross all your's project.
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
@@ -26,13 +26,14 @@ $: ruby your_file.rb # add pry! in your_file for start pry session
|
|
26
26
|
|
27
27
|
or Run your's code directly use:
|
28
28
|
|
29
|
+
|
29
30
|
```sh
|
30
31
|
$: RUBYOPT+='-rpryx' ruby your_file.rb # add pry! in your_file for start pry session
|
31
32
|
```
|
32
33
|
|
33
34
|
Then, try add `pry!` into your's ruby code, then run it, have fun!
|
34
35
|
|
35
|
-
Following is a example, assume
|
36
|
+
Following is a example, assume there is a `test.rb` with content:
|
36
37
|
|
37
38
|
```rb
|
38
39
|
# test.rb
|
@@ -51,58 +52,46 @@ use http connection.
|
|
51
52
|
|
52
53
|
![pry_remote.png](images/pry_remote.png)
|
53
54
|
|
54
|
-
|
55
55
|
Until now, you've only seen the tip of the iceberg, please have a try.
|
56
56
|
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
```sh
|
61
|
-
$: export RUBYOPT+=' -rpryx_irb'
|
62
|
-
$: ruby your_file.rb # add pry! in your_file for start pry session
|
63
|
-
```
|
58
|
+
the preferred way to use pryx is add `export RUBYOPT+=' -rpryx'` to system start script.
|
64
59
|
|
65
|
-
|
66
|
-
|
67
|
-
only several methods added into Kernel#, and gems only be require if you run invoke
|
68
|
-
those added methods.
|
60
|
+
It should almost not affect your's code too much, only special methods defined into Kernel#,
|
61
|
+
no any gem be required before you invoke those added methods.
|
69
62
|
|
70
63
|
## useful command which added directly to Kernel#
|
71
64
|
|
72
|
-
### Kernel#pry!
|
73
|
-
|
65
|
+
### Kernel#pry!
|
66
|
+
|
74
67
|
start a pry session, this session only can be intercept once if add into a loop.
|
75
68
|
when used with a rails/roda web server, it only intercept one per request.
|
76
69
|
|
77
|
-
we have IRB equivalent, named `irb!`,
|
78
|
-
|
79
|
-
```sh
|
80
|
-
$: RUBYOPT+='-rpryx_irb' ruby your_file.rb # add irb! in your_file for start pry session
|
81
|
-
```
|
70
|
+
we have IRB equivalent, named `irb!`, though, only a little feature support it.
|
82
71
|
|
83
72
|
Following feature both available when start a Pry or IRB session:
|
84
73
|
|
85
|
-
1. Add `
|
86
|
-
2.
|
87
|
-
3. Use `
|
88
|
-
4. Use `Clipboard.copy` or `Clipboard.paste` to interactive with system clipboard. see [clipboard](https://github.com/janlelis/clipboard)
|
74
|
+
1. Add `Kernel#ls1`(use ls1 to avoid conflict with pry builtin ls command), see [looksee](https://github.com/oggy/looksee)
|
75
|
+
2. Use `ap` for pretty print. see [awesome-print](https://github.com/awesome-print/awesome_print)
|
76
|
+
3. Use `Clipboard.copy` or `Clipboard.paste` to interactive with system clipboard. see [clipboard](https://github.com/janlelis/clipboard)
|
89
77
|
|
90
|
-
Following
|
78
|
+
Following feature available only for a Pry session:
|
91
79
|
|
92
|
-
1. Add
|
93
|
-
2.
|
80
|
+
1. Add `next/step/continue/up/down` command for debug, use [pry-nav](https://github.com/nixme/pry-nav) [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
|
81
|
+
2. Add `$/?` command for see source, see [pry-doc](https://github.com/pry/pry-doc)
|
82
|
+
3. pry-remote debug support. you still use `pry!` no changes, it will use `pry-remote` automatically
|
94
83
|
if current ruby process was running on backround, then, it will use pry-remote, and listen on 0.0.0.0:9876,
|
95
84
|
Then, you can connect to it from another terminal! see [pry-remote](https://github.com/Mon-Ouie/pry-remote)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
85
|
+
4. Add `pa` command, see [pry-power_assert](https://github.com/yui-knk/pry-power_assert)
|
86
|
+
5. Add `hier` command for print the class hierarchies, see [pry-hier](https://github.com/phaul/pry-hier)
|
87
|
+
6. Add `pry-aa_ancestors` command for print the class hierarchy, see [pry-aa_ancestors](https://github.com/tbpgr/pry-aa_ancestors)
|
88
|
+
7. Add `up/down/frame/stack` command, see [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
|
89
|
+
8. Add `yes` or `y` command, see [pry-yes](https://github.com/christofferh/pry-yes)
|
101
90
|
9. Add `pry-disam`, Check following screenshot for a example:
|
102
91
|
|
103
92
|
![pry-disasm](images/disasm.png)
|
104
93
|
|
105
|
-
### Kernel#pry1 Kernel#pry2 (sorry for
|
94
|
+
### Kernel#pry1 Kernel#pry2 (sorry for the bad name, please create a issue you have a better one)
|
106
95
|
|
107
96
|
pry2 do nothing, but it will be interceptd and start a pry session only after pry1 is running.
|
108
97
|
|
@@ -153,8 +142,10 @@ But, you should only use it in development, though, it was tested is run in cont
|
|
153
142
|
|
154
143
|
## Limit
|
155
144
|
|
156
|
-
1.
|
157
|
-
|
145
|
+
1. When use looksee with irb for Ruby 3.1.x, looksee output color was not correct displayed.
|
146
|
+
check: https://github.com/oggy/looksee/issues/57
|
147
|
+
2. Pry's show auto-watch when not work, because `Enter` key rebinding to `run the last command`.
|
148
|
+
i consider this is more useful, you can always use `w` alias to see the watch changes.
|
158
149
|
|
159
150
|
## Support
|
160
151
|
|
data/bin/irbx
CHANGED
data/bin/pryx
CHANGED
data/lib/pryx/ap_hack.rb
CHANGED
data/lib/pryx/common_plugins.rb
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
require 'binding_of_caller'
|
2
1
|
require 'clipboard'
|
3
|
-
|
4
|
-
# HACK: for ap 可以确保,当使用 irb! 时,looksee ls1 输出显示正确,同时不用关闭 irb :USE_COLORIZE 设置。
|
5
|
-
# See https://github.com/oggy/looksee/issues/57
|
6
|
-
# 但是,ap_hack 必须放到 break_hack 前面,调换顺序,上面的 hack 失效。
|
7
|
-
# WARN: 下面两行 require 代码顺序不要换。
|
8
2
|
require 'pryx/ap_hack'
|
9
|
-
require '
|
10
|
-
Pry.commands.alias_command 'n', 'next'
|
11
|
-
Pry.commands.alias_command 's', 'step'
|
12
|
-
Pry.commands.alias_command 'w', 'watch' # watch is pry builtin
|
3
|
+
require 'pryx/looksee_hack'
|
data/lib/pryx/irb_hack.rb
CHANGED
@@ -2,17 +2,7 @@ class Binding
|
|
2
2
|
def _irb(_host=nil)
|
3
3
|
warn '[1m[33mloading irb ...[0m'
|
4
4
|
|
5
|
-
|
6
|
-
# This is need for work with looksee better.
|
7
|
-
# See discuss on https://github.com/oggy/looksee/issues/57
|
8
|
-
IRB.conf[:USE_COLORIZE] = false
|
9
|
-
else
|
10
|
-
warn "For work with Break and Looksee, please set
|
11
|
-
export RUBYOPT='-rpryx_irb'
|
12
|
-
instead of
|
13
|
-
export RUBYOPT='-rpryx'
|
14
|
-
"
|
15
|
-
end
|
5
|
+
require 'pryx/common_plugins'
|
16
6
|
|
17
7
|
self.irb
|
18
8
|
end
|
@@ -24,8 +14,6 @@ module Kernel
|
|
24
14
|
|
25
15
|
ENV['IRB_was_started'] = 'true'
|
26
16
|
|
27
|
-
require 'binding_of_caller'
|
28
|
-
|
29
17
|
irb3(2)
|
30
18
|
end
|
31
19
|
|
@@ -40,9 +28,6 @@ module Kernel
|
|
40
28
|
def irb2
|
41
29
|
if ENV['IRB2_should_start'] == 'true'
|
42
30
|
ENV['IRB2_should_start'] = nil
|
43
|
-
|
44
|
-
require 'binding_of_caller'
|
45
|
-
|
46
31
|
irb3(2)
|
47
32
|
end
|
48
33
|
end
|
data/lib/pryx/looksee_hack.rb
CHANGED
@@ -11,12 +11,8 @@
|
|
11
11
|
|
12
12
|
module Kernel
|
13
13
|
def _load_looksee
|
14
|
-
|
15
|
-
|
16
|
-
require 'old_looksee'
|
17
|
-
when '2.1.0'...'3.2.0'
|
18
|
-
require 'looksee'
|
19
|
-
end
|
14
|
+
require 'looksee'
|
15
|
+
|
20
16
|
Looksee.rename :ls_looksee
|
21
17
|
|
22
18
|
Looksee.editor = '.emacsclient +%l %f' # e.g. [].ls1.edit :to_set
|
data/lib/pryx/pry_hack.rb
CHANGED
data/lib/pryx/pry_plugins.rb
CHANGED
@@ -17,8 +17,10 @@ Pry::Commands.alias_command 'aa', 'aa_ancestors'
|
|
17
17
|
require 'pry-stack_explorer' # Add command `up/down/frame[n]/stack`
|
18
18
|
require 'pryx/pry-stack_explorer_hack'
|
19
19
|
|
20
|
+
require 'pry-nav'
|
21
|
+
|
20
22
|
# Add command `cc`
|
21
|
-
Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint' do
|
23
|
+
Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint too' do
|
22
24
|
Pry.instance_variable_set(:@initial_session, true)
|
23
25
|
ENV['Pry_was_started'] = nil
|
24
26
|
throw(:breakout)
|
@@ -26,7 +28,9 @@ end
|
|
26
28
|
|
27
29
|
Pry.commands.alias_command 'wai', 'whereami' # Add command alias `wai`
|
28
30
|
|
29
|
-
# Hit Enter repeat last command
|
31
|
+
# Hit Enter repeat last command, this feature will make auto-watch unavailable.
|
30
32
|
Pry::Commands.command(/^$/, 'repeat last command') do
|
31
|
-
|
33
|
+
run Pry.history.to_a.last
|
32
34
|
end
|
35
|
+
# So, add a new alias w for user use it manually
|
36
|
+
Pry.commands.alias_command 'w', 'watch' # watch is pry builtin
|
data/lib/pryx/version.rb
CHANGED
data/lib/pryx.rb
CHANGED
data/lib/pryx_cli.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
|
-
require 'clipboard'
|
2
|
-
|
3
|
-
require 'pryx/ap_hack'
|
4
|
-
|
5
1
|
# This require is needed, because can't require looksee in method when use with bundler.
|
6
2
|
# bundler remove looksee from $LOAD_PATH when start with rails.
|
7
3
|
require 'looksee'
|
8
|
-
require 'pryx/
|
9
|
-
|
4
|
+
require 'pryx/common_plugins'
|
10
5
|
require 'pryx'
|
11
6
|
|
12
7
|
if File.exist? 'config/environment.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pryx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Billy.Zheng(zw963)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -25,61 +25,61 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: clipboard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '1.3'
|
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:
|
40
|
+
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0.14'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0.14'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: pry-nav
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: looksee
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '4.4'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '4.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry-aa_ancestors
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,7 +247,6 @@ files:
|
|
247
247
|
- lib/pryx/trap_backtrace.rb
|
248
248
|
- lib/pryx/version.rb
|
249
249
|
- lib/pryx_cli.rb
|
250
|
-
- lib/pryx_irb.rb
|
251
250
|
homepage: http://github.com/zw963/pryx
|
252
251
|
licenses:
|
253
252
|
- MIT
|
@@ -268,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
267
|
- !ruby/object:Gem::Version
|
269
268
|
version: '0'
|
270
269
|
requirements: []
|
271
|
-
rubygems_version: 3.3.
|
270
|
+
rubygems_version: 3.3.7
|
272
271
|
signing_key:
|
273
272
|
specification_version: 4
|
274
273
|
summary: pry extension tools!
|
data/lib/pryx_irb.rb
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# We need apply those hack before irb was loaded for work with irb.
|
2
|
-
# So we have to add it here, same hacks for Pry is add to method
|
3
|
-
# Binding#_pry which defined in lib/pryx/pry_hack.rb
|
4
|
-
|
5
|
-
# we need set `export RUBYOPT+=" -rpryx_irb"` instead of `-rpryx` to make
|
6
|
-
# irb work with break and ap gem.
|
7
|
-
|
8
|
-
require 'pryx/common_plugins'
|
9
|
-
require 'pryx'
|