pryx 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -3
- data/lib/pryx/version.rb +1 -1
- data/lib/pryx.rb +5 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 310c66efaf82c0d0412d0214a41ea97216a6f9e7de4d37a4dc70e658ae6a118c
|
4
|
+
data.tar.gz: de397ac717b14c7b5d9c1a9757b17b74ec29add25dd825b9c04ad6eb5d33a0cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ebea7fb65fd64480bd49eb78862c7b060e24eb3ade6ca601b8f23581e3dccd5b6fa59a97a898be61f5413ee718a09cca89a7ab9d475751fa3e3cd01a6ff6698
|
7
|
+
data.tar.gz: 136a0d08508458f9c209520309ea002b03dc51bb5e7ad1b0d794458d701b4b756182303981c2eb13f7ce2f2973ca81786e892289e2a8a4765e1fff9daba3d1a6
|
data/README.md
CHANGED
@@ -4,6 +4,8 @@ Three Virtues of a Programmer: Laziness, Impatience, and Hubris. -- Larry Wall,
|
|
4
4
|
|
5
5
|
## Getting Started
|
6
6
|
|
7
|
+
[NOTICE] Check [What's new in Ruby 3.2's IRB?](https://st0012.dev/whats-new-in-ruby-3-2-irb) for the introduced new feature of Ruby 3.2 IRB which includes part of feature this gem provides.
|
8
|
+
|
7
9
|
Don't add this gem into bundler's Gemfile.
|
8
10
|
|
9
11
|
Instead, install it directly via RubyGems
|
@@ -14,12 +16,54 @@ Then user can use pryx cross all your's project.
|
|
14
16
|
|
15
17
|
## Usage
|
16
18
|
|
19
|
+
At first, it is just pry, with more extensions.
|
20
|
+
|
21
|
+
you can always run it with `pryx`.
|
22
|
+
|
23
|
+
```sh
|
24
|
+
╰─ $ pryx
|
25
|
+
[1] pry(main)> ? Array#each_with_object
|
26
|
+
|
27
|
+
From: enum.c (C Method):
|
28
|
+
Owner: Enumerable
|
29
|
+
Visibility: public
|
30
|
+
Signature: each_with_object(arg1)
|
31
|
+
Number of lines: 20
|
32
|
+
|
33
|
+
Calls the block once for each element, passing both the element
|
34
|
+
and the given object:
|
35
|
+
|
36
|
+
(1..4).each_with_object([]) {|i, a| a.push(i**2) }
|
37
|
+
# => [1, 4, 9, 16]
|
38
|
+
|
39
|
+
{foo: 0, bar: 1, baz: 2}.each_with_object({}) {|(k, v), h| h[v] = k }
|
40
|
+
# => {0=>:foo, 1=>:bar, 2=>:baz}
|
41
|
+
|
42
|
+
With no block given, returns an Enumerator.
|
43
|
+
|
44
|
+
static VALUE
|
45
|
+
enum_each_with_object(VALUE obj, VALUE memo)
|
46
|
+
{
|
47
|
+
RETURN_SIZED_ENUMERATOR(obj, 1, &memo, enum_size);
|
48
|
+
|
49
|
+
rb_block_call(obj, id_each, 0, 0, each_with_object_i, memo);
|
50
|
+
|
51
|
+
return memo;
|
52
|
+
}
|
53
|
+
[2] pry(main)>
|
54
|
+
|
55
|
+
```
|
56
|
+
|
57
|
+
Second, it add a new `Kernel#pry!`, you can use it instead of `binding.pry`.
|
58
|
+
It's not just an alias, there are more.
|
59
|
+
|
17
60
|
Before use it, you need set `RUBYOPT` variable.
|
18
61
|
|
19
62
|
You can do this two way in a terminal.
|
20
63
|
|
21
64
|
```sh
|
22
|
-
$: export RUBYOPT+=' -rpryx'
|
65
|
+
$: export RUBYOPT+=' -rpryx' # For BASH only
|
66
|
+
$: export RUBYOPT="$RUBYOPT -rpryx" # For others shell
|
23
67
|
$: ruby your_file.rb # add pry! in your_file for start pry session
|
24
68
|
|
25
69
|
```
|
@@ -31,8 +75,6 @@ or Run your's code directly use:
|
|
31
75
|
$: RUBYOPT+='-rpryx' ruby your_file.rb # add pry! in your_file for start pry session
|
32
76
|
```
|
33
77
|
|
34
|
-
Then, try add `pry!` into your's ruby code, then run it, have fun!
|
35
|
-
|
36
78
|
Following is a example, assume there is a `test.rb` with content:
|
37
79
|
|
38
80
|
```rb
|
data/lib/pryx/version.rb
CHANGED
data/lib/pryx.rb
CHANGED
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.10.
|
4
|
+
version: 0.10.2
|
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: 2024-
|
11
|
+
date: 2024-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.0.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: readline-ext
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: looksee
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +156,14 @@ dependencies:
|
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '1.
|
159
|
+
version: '1.6'
|
146
160
|
type: :runtime
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '1.
|
166
|
+
version: '1.6'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: pry-stack_explorer
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
281
|
- !ruby/object:Gem::Version
|
268
282
|
version: '0'
|
269
283
|
requirements: []
|
270
|
-
rubygems_version: 3.3
|
284
|
+
rubygems_version: 3.5.3
|
271
285
|
signing_key:
|
272
286
|
specification_version: 4
|
273
287
|
summary: pry extension tools!
|