pryx 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dc55b47663a1ef4812e8c462d08d69816ca9e8034c39cf73f118e57c020eada
4
- data.tar.gz: ea4bc22be549f9dcd3ba149ae8c1946f258564d10b9a4126c150115fe3cd6df1
3
+ metadata.gz: d4f8e26858d1dfc13351ca2e8287a4aae69a1be7bf123f98ff7556f006a706a2
4
+ data.tar.gz: c921a886c8a596e129037bf74c8837a97e2d934b7943aa78b923945c6cc04855
5
5
  SHA512:
6
- metadata.gz: 5b8dacec92274b90a844479b7a0c1b473fc1a84e530a9da411a021dfe32476283a86b91c3219a1c8e8d3459319cf1838ce271a0070880bde6a8338130ad64286
7
- data.tar.gz: 1e36fb07f093e6d53079fb8d4a074b3c391cceebab425602fc60df8e5bfec55cd3647232dd87de6a949f584a73ad448847245d8218c61565afc365de46f1ee26
6
+ metadata.gz: 734080308ca63da288f250c333c60fece9de7d29612f705953859f78241768bfcacb2c7ef7a5e414f54f65d9eacc99c16508f91230de8ad8bfb90cb72c21e250
7
+ data.tar.gz: 429e9841ff95fa3327b1c48f39c588f6fac4c0b5d418589ab1723f15e29f183ab10114ba81df96b027af63615152f05a21c8876776597651d9b4f23eb4dab686
data/README.md CHANGED
@@ -9,6 +9,8 @@ Don't add this gem into bundler's Gemfile.
9
9
  Instead, install it directly via RubyGems
10
10
 
11
11
  $ gem install pryx
12
+
13
+ Then use can use pryx cross all your's project.
12
14
 
13
15
  ## Usage
14
16
 
@@ -30,9 +32,32 @@ $: RUBYOPT+='-rpryx' ruby your_file.rb # add pry! in your_file for start pry se
30
32
 
31
33
  Then, try add `pry!` into your's ruby code, then run it, have fun!
32
34
 
33
- ## useful command add directly to Kernel#
35
+ Following is a example, assume we have test.rb, it content like this:
36
+
37
+ ```rb
38
+ # test.rb
39
+ 3.times do
40
+ pry!
41
+ puts 'hello'
42
+ end
43
+ ```
44
+
45
+ Then, when you run `RUBYOPT='-rpryx' ruby test.rb`
46
+
47
+ ![pry.png](images/pry!.png)
48
+
49
+ You can even connect to a pry session started from remote or background process
50
+ use http connection.
51
+
52
+ ![pry_remote.png](images/pry_remote.png)
53
+
34
54
 
35
- ### pry!
55
+ Until now, you've only seen the tip of the iceberg, please have a try.
56
+
57
+
58
+ ## useful command which added directly to Kernel#
59
+
60
+ ### Kernel#pry!
36
61
 
37
62
  start a pry session, this session only can be intercept once if add into a loop.
38
63
  when used with a rails/roda web server, it only intercept one per request.
@@ -61,7 +86,7 @@ Following feature only available when start a Pry session:
61
86
  6. add `up/down/frame/stack` command, see [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
62
87
  2. add `yes` or `y` command, see [pry-yes](https://github.com/christofferh/pry-yes)
63
88
 
64
- ### pry1 pry2 (sorry for this bad name, please create a issue you have a better one)
89
+ ### Kernel#pry1 Kernel#pry2 (sorry for this bad name, please create a issue you have a better one)
65
90
 
66
91
  pry2 do nothing, but it will be interceptd and start a pry session only after pry1 is running.
67
92
 
@@ -69,23 +94,33 @@ I haven use this hack for avoid pry session start on working place.
69
94
 
70
95
  You know what i means.
71
96
 
72
- ### irb1 irb2
97
+ ### Kernel#irb1 Kernel#irb2
73
98
 
74
99
  IRB equivalent for pry1, pry2
75
100
  we have irb1 and irb2 too.
76
101
 
77
- ### pry3
102
+ ### Kernel#pry3
78
103
 
79
104
  It just normal `binding.pry`, that is, will always be intercept if code can reach.
80
105
  but above plugins and libraries all correct configured.
81
106
 
82
107
  we have another Kernel#pry?, which enable `pry-state` automatically, see [pry-state](https://github.com/SudhagarS/pry-state)
83
108
 
84
- ### we have two binary, pryx, irbx
109
+ ### We add three command line command, pryx, irbx, pry!
85
110
 
86
111
  pryx is same as pry, but, with plugins and libraries correct configured.
87
112
 
88
- irbx is same for irb.
113
+ irbx is same things for irb.
114
+
115
+ pry! just a alias to `pry-remote` command, when `Kernel#pry!` was intercepted in a background process,
116
+ you can run `pry!` directly in terminal connect to it.
117
+
118
+ if your's pry-remote server started background on another host, or on a container, you man need
119
+ specify hostname and port, e.g. connnect to 192.168.1.100, with port 9876
120
+
121
+ ```sh
122
+ $: pry! -s 192.168.1.100 -p 9876
123
+ ```
89
124
 
90
125
  ## Philosophy
91
126
 
@@ -94,7 +129,7 @@ But, you should only use it when development, though, it was tested when use in
94
129
 
95
130
  ## Support
96
131
 
97
- * MRI 2.2+
132
+ * MRI 2.6+
98
133
 
99
134
  ## History
100
135
 
data/lib/pry-disasm.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'pry'
4
2
  require 'pry-disasm/commands'
5
3
 
data/lib/pryx/pry_hack.rb CHANGED
@@ -11,31 +11,8 @@ class Binding
11
11
  end
12
12
 
13
13
  require 'pryx/ap_hack'
14
-
15
14
  require 'pryx/break_hack'
16
-
17
- require 'pry-power_assert'
18
-
19
- require 'pry-doc'
20
-
21
- require 'pry-yes'
22
- Pry.commands.alias_command 'y', 'yes'
23
-
24
- require 'pry-hier'
25
-
26
- require 'pry-aa_ancestors'
27
- Pry::Commands.alias_command 'aa', 'aa_ancestors'
28
-
29
- # 这个必须在最后才有效, 但是目前存在一个问题,就是会将 pry3, pry! 加入 stacks
30
- # stack 显示 stack 的列表,frame 显示当前所在 stack, stack N 也可以根据数字跳转到 N
31
- require 'pry-stack_explorer' # Support: up, down, bottom, top, stack, frame
32
-
33
-
34
- Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint' do
35
- Pry.instance_variable_set(:@initial_session, true)
36
- ENV['Pry_was_started'] = nil
37
- throw(:breakout)
38
- end
15
+ require 'pryx/pry_plugins'
39
16
 
40
17
  if host
41
18
  notify_send('loading remote pry ...')
@@ -0,0 +1,21 @@
1
+ require 'pry-power_assert'
2
+
3
+ require 'pry-doc'
4
+
5
+ require 'pry-yes'
6
+ Pry.commands.alias_command 'y', 'yes'
7
+
8
+ require 'pry-hier'
9
+
10
+ require 'pry-aa_ancestors'
11
+ Pry::Commands.alias_command 'aa', 'aa_ancestors'
12
+
13
+ # 这个必须在最后才有效, 但是目前存在一个问题,就是会将 pry3, pry! 加入 stacks
14
+ # stack 显示 stack 的列表,frame 显示当前所在 stack, stack N 也可以根据数字跳转到 N
15
+ require 'pry-stack_explorer' # Support: up, down, bottom, top, stack, frame
16
+
17
+ Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint' do
18
+ Pry.instance_variable_set(:@initial_session, true)
19
+ ENV['Pry_was_started'] = nil
20
+ throw(:breakout)
21
+ end
data/lib/pryx/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pryx
4
- VERSION = [0, 4, 2]
4
+ VERSION = [0, 5, 0]
5
5
 
6
6
  class << VERSION
7
7
  include Comparable
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.2
4
+ version: 0.5.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-04-22 00:00:00.000000000 Z
11
+ date: 2022-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.4'
159
+ version: '0.5'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.4'
166
+ version: '0.5'
167
167
  description: ''
168
168
  email:
169
169
  - vil963@gmail.com
@@ -201,6 +201,7 @@ files:
201
201
  - lib/pryx/irb_hack.rb
202
202
  - lib/pryx/looksee_hack.rb
203
203
  - lib/pryx/pry_hack.rb
204
+ - lib/pryx/pry_plugins.rb
204
205
  - lib/pryx/trap_backtrace.rb
205
206
  - lib/pryx/version.rb
206
207
  - lib/pryx_irb.rb
@@ -217,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
218
  requirements:
218
219
  - - ">="
219
220
  - !ruby/object:Gem::Version
220
- version: 2.2.2
221
+ version: '2.6'
221
222
  required_rubygems_version: !ruby/object:Gem::Requirement
222
223
  requirements:
223
224
  - - ">="