irbtools 4.0.11 → 4.1.0

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: 44ccbf7fb49cafe47076915ecf90d147def9870ded841c76d5f396d2f67bfbb4
4
- data.tar.gz: 3c3dc45babe8cf5bc51d91b5391ebc83e51e71dcfd3d38dac30d92f60f12173a
3
+ metadata.gz: 057ccf651fd4fcb5a0b5b9c9e465a22805fd06c3e1807db2d4ecc25164ed4065
4
+ data.tar.gz: 6910623184264bad5962e142b845e48418e99164204e867e14c66eb9a6a8cad9
5
5
  SHA512:
6
- metadata.gz: 8113a6f10d68835a2172d7a1890d4f591e1138733ffc06749b7879ab26b67e662f51b12351079930c6607b8a805fbd714488e5b18e8bb44334ea14847212f822
7
- data.tar.gz: 1a853f5723819aeb2c063f39b67dee1db1e54eb83c2481cbb3f4b2a321d5e5a436fad41bfa84041c2f68f1a8118154d388f6a894b45fcebf1c3c28052f3d4013
6
+ metadata.gz: d9005040abdcc670c7d7c786e98eb2d7013fdaf9a10bd701ea0404b7a2c97eba656b2f26831f4acf1826a70eec03eede34c28d80dd1d00b07e9a3b967cfd4eb3
7
+ data.tar.gz: effd68833e3e32a02ec171959fc6ee9c5d94fc10dd19eaba1903fb1f00a654728e1254fdb4d4ca7e489547f216d15574995b3983b926f75c45169223421df8a1
data/CHANGELOG.md CHANGED
@@ -1,293 +1,347 @@
1
1
  # Irbtools Changelog
2
2
 
3
+ ## 4.1.0
4
+
5
+ - Fix command loading (was broken in previous version)
6
+ - Minor changes to command argument parsing
7
+ - Set required IRB to 1.13.0
8
+
3
9
  ## 4.0.11
4
10
 
5
- * Loosen IRB dependency to allow IRB 1.14
11
+ - Loosen IRB dependency to allow IRB 1.14
6
12
 
7
13
  ## 4.0.10
8
14
 
9
- * Loosen IRB dependency to allow IRB 1.13, fixes #57
15
+ - Loosen IRB dependency to allow IRB 1.13, fixes #57
10
16
 
11
17
  ## 4.0.9
12
18
 
13
- * Fix loading command `Base` class and require IRB 1.12 to make sure it is available
19
+ - Fix loading command `Base` class and require IRB 1.12 to make sure it is available
14
20
 
15
21
  ## 4.0.8
16
22
 
17
- * Require IRB 1.11
18
- * Fix "NameError: uninitialized constant IRB::ExtendCommand::Nop"
19
- * Bump core_docs gem
23
+ - Require IRB 1.11
24
+ - Fix "NameError: uninitialized constant IRB::ExtendCommand::Nop"
25
+ - Bump core_docs gem
20
26
 
21
27
  ## 4.0.7
22
28
 
23
- * Allow clipboard gem v2
29
+ - Allow clipboard gem v2
24
30
 
25
31
  ## 4.0.6
26
32
 
27
- * Bump FancyIRB to close #56
33
+ - Bump FancyIRB to close #56
28
34
 
29
35
  ## 4.0.5
30
36
 
31
- * Bump IRB and FancyIRB
37
+ - Bump IRB and FancyIRB
32
38
 
33
39
  ## 4.0.4
34
40
 
35
- * Loosen IRB dependency
41
+ - Loosen IRB dependency
36
42
 
37
43
  ## 4.0.3
38
44
 
39
- * code / howtocall commands: Support question mark / exclamation mark methods
45
+ - code / howtocall commands: Support question mark / exclamation mark methods
40
46
 
41
47
  ## 4.0.2
42
48
 
43
- * Bump interactive_editor gem (Ruby 3.2 compatibility)
49
+ - Bump interactive_editor gem (Ruby 3.2 compatibility)
44
50
 
45
51
  ## 4.0.1
46
52
 
47
- * Bump ruby_engine gem
53
+ - Bump ruby_engine gem
48
54
 
49
55
  ## 4.0.0
50
56
 
51
- * Requires IRB 1.6 (Ruby 3.2 bundles IRB 1.6.2)
52
- * Requires Ruby 3.0
57
+ - Requires IRB 1.6 (Ruby 3.2 bundles IRB 1.6.2)
58
+ - Requires Ruby 3.0
59
+
60
+ - Remove a bunch of gems:
61
+
62
+ - Drop binding.repl gem since it was only needed for older Rubies
63
+ - Drop ori gem, since IRB now has `show_doc`
64
+ - Drop RubyInfo
53
65
 
54
- * Remove a bunch of gems:
55
- * Drop binding.repl gem since it was only needed for older Rubies
56
- * Drop ori gem, since IRB now has `show_doc`
57
- * Drop RubyInfo
66
+ - Retire irbtools-more:
58
67
 
59
- * Retire irbtools-more:
60
- * Move looksee to core irbtools
61
- * Move core_docs to core irbtools
62
- * Remove bond (outdated)
63
- * Leave binding_of_caller optional
68
+ - Move looksee to core irbtools
69
+ - Move core_docs to core irbtools
70
+ - Remove bond (outdated)
71
+ - Leave binding_of_caller optional
64
72
 
65
- * Add command wrappers for code, howtocall, looksee, shadow
66
- * Add `$` command to directly call system
73
+ - Add command wrappers for code, howtocall, looksee, shadow
74
+ - Add `$` command to directly call system
67
75
 
68
- * Version bumps: looksee, os, methodfinder, code, core_docs, debugging
69
- * Alias IRB's ls to ils (fixes #53)
70
- * Remove support for RIPL repl (outdated)
76
+ - Version bumps: looksee, os, methodfinder, code, core_docs, debugging
77
+ - Alias IRB's ls to ils (fixes #53)
78
+ - Remove support for RIPL repl (outdated)
71
79
 
72
80
  ## 3.0.5
73
- * Bump methodfinder dependency & update usage (fixes #52)
81
+
82
+ - Bump methodfinder dependency & update usage (fixes #52)
74
83
 
75
84
  ## 3.0.4
76
- * Loosen Ruby dependency to allow Ruby 3.0
85
+
86
+ - Loosen Ruby dependency to allow Ruby 3.0
77
87
 
78
88
  ## 3.0.3
79
- * Workaround a HIRB issue for newer IRBs (fixes #48)
80
- * Workaround ORI issue for newer IRBs
89
+
90
+ - Workaround a HIRB issue for newer IRBs (fixes #48)
91
+ - Workaround ORI issue for newer IRBs
81
92
 
82
93
  ## 3.0.2
83
- * Bump wirb to ensure Ruby 2.7 compatibility
94
+
95
+ - Bump wirb to ensure Ruby 2.7 compatibility
84
96
 
85
97
  ## 3.0.1
86
- * Bump fancy_irb to ensure Ruby 2.7 compatiblity
98
+
99
+ - Bump fancy_irb to ensure Ruby 2.7 compatiblity
87
100
 
88
101
  ## 3.0.0
89
- * Make IRB itself a dependency (default gem)
90
- * Move: "Every day… IRB" into its own git repository
91
- * https://github.com/janlelis/every_day_irb
92
- * Replace instance and method_locator gems with new object_shadow gem
93
- * Improve README
94
- * Version bump code, clipboard, and methodfinder
102
+
103
+ - Make IRB itself a dependency (default gem)
104
+ - Move: "Every day… IRB" into its own git repository
105
+ - https://github.com/janlelis/every_day_irb
106
+ - Replace instance and method_locator gems with new object_shadow gem
107
+ - Improve README
108
+ - Version bump code, clipboard, and methodfinder
95
109
 
96
110
  ## 2.2.2
97
- * Remove Rails WIRB loading hack (no longer necessary)
111
+
112
+ - Remove Rails WIRB loading hack (no longer necessary)
98
113
 
99
114
  ## 2.2.1
100
- * Allow os gem to be below 1.0
101
- * Do not use binding.repl gem if Ruby version is at least 2.5
115
+
116
+ - Allow os gem to be below 1.0
117
+ - Do not use binding.repl gem if Ruby version is at least 2.5
102
118
 
103
119
  ## 2.2.0
104
- * Remove info, version, engine, and os methods. Use RubyInfo, RubyVersion, RubyEngine, and OS instead (fixes #40)
120
+
121
+ - Remove info, version, engine, and os methods. Use RubyInfo, RubyVersion, RubyEngine, and OS instead (fixes #40)
105
122
 
106
123
  ## 2.1.0
107
- * Improve Rails compatibility
108
- * Do not load instance gem in the context of Rails
109
- * Make sure to actually require "irb" before using it
110
- * Use terrible hack to load Wirb in context of Rails
111
- * Relax paint dependency (allows usage of paint >= 2.0)
112
- * Require new versions of fancy_irb, clipboard, os
113
- * Set abort_on_exception to true for late threads (early threads do this implicitly via join)
124
+
125
+ - Improve Rails compatibility
126
+ - Do not load instance gem in the context of Rails
127
+ - Make sure to actually require "irb" before using it
128
+ - Use terrible hack to load Wirb in context of Rails
129
+ - Relax paint dependency (allows usage of paint >= 2.0)
130
+ - Require new versions of fancy_irb, clipboard, os
131
+ - Set abort_on_exception to true for late threads (early threads do this implicitly via join)
114
132
 
115
133
  ## 2.0.1
116
- * Remove g gem
134
+
135
+ - Remove g gem
117
136
 
118
137
  ## 2.0.0
119
- * Use Wirb 2.0 and FancyIrb 1.0
120
- * Drop support for Ruby 1
121
- * Simplify starting from code via: require 'irbtools/binding'
122
- * Rename method to show a method's source to: code
123
- * Add instance gem
124
- * Remove code organization gems (boson + alias)
125
- * Don't add '.' to the load path, use rr (require_relative) instead
126
- * Improve loading order of libraries
127
- * Remove aliases for Irbtools configuration
128
- * Integrate irbtools-more into irbtools main repo
129
- * EveryDayIrb now gets released on its own, instead with every new irbtools version
130
- * Improve documentation in Readme
138
+
139
+ - Use Wirb 2.0 and FancyIrb 1.0
140
+ - Drop support for Ruby 1
141
+ - Simplify starting from code via: require 'irbtools/binding'
142
+ - Rename method to show a method's source to: code
143
+ - Add instance gem
144
+ - Remove code organization gems (boson + alias)
145
+ - Don't add '.' to the load path, use rr (require_relative) instead
146
+ - Improve loading order of libraries
147
+ - Remove aliases for Irbtools configuration
148
+ - Integrate irbtools-more into irbtools main repo
149
+ - EveryDayIrb now gets released on its own, instead with every new irbtools version
150
+ - Improve documentation in Readme
131
151
 
132
152
  ## 1.7.1
133
- * bump binding.repl, hirb, methodfinder
153
+
154
+ - bump binding.repl, hirb, methodfinder
134
155
 
135
156
  ## 1.7.0
136
- * bump boson, boson-more, binding.repl
137
- * required ruby version: 1.9.3
138
- * remove awesome_print
157
+
158
+ - bump boson, boson-more, binding.repl
159
+ - required ruby version: 1.9.3
160
+ - remove awesome_print
139
161
 
140
162
  ## 1.6.1
141
- * don't load debugging/repl by default
142
- * rename re method to engine and rv to version
163
+
164
+ - don't load debugging/repl by default
165
+ - rename re method to engine and rv to version
143
166
 
144
167
  ## 1.6.0
145
- * remove zucker dependency, but add debugging, ruby_version, ruby_engine, ruby_info and os gem
146
- * configure binding.repl to load irb, not pry
147
- * bump binding.repl, paint, wirb
168
+
169
+ - remove zucker dependency, but add debugging, ruby_version, ruby_engine, ruby_info and os gem
170
+ - configure binding.repl to load irb, not pry
171
+ - bump binding.repl, paint, wirb
148
172
 
149
173
  ## 1.5.1
150
- * include binding.repl gem
151
- * bump coderay, awesome_print, method_source, wirb
174
+
175
+ - include binding.repl gem
176
+ - bump coderay, awesome_print, method_source, wirb
152
177
 
153
178
  ## 1.5.0
154
- * update debundle hack
155
- * load less zucker libraries
156
- * add alias gem
157
- * finaly load boson correctly (but don't load any boson plugin, yet), also depend on boson-more
158
- * version bumps (zucker, clipboard, paint, hirb, wirb, ap, coderay, g)
179
+
180
+ - update debundle hack
181
+ - load less zucker libraries
182
+ - add alias gem
183
+ - finaly load boson correctly (but don't load any boson plugin, yet), also depend on boson-more
184
+ - version bumps (zucker, clipboard, paint, hirb, wirb, ap, coderay, g)
159
185
 
160
186
  ## 1.4.0
161
- * every_day_irb is now a module that extends self
162
- * specs for most of every_day_irb's functionality
163
- * add helper method for paging output with hirb: page
164
- * version bumps, including wirb and fancy_irb
165
- * remove sketches dependency, it's a great gem, but very similar to interactive_editor
166
- * Object#mlp alias for method_lookup_path
187
+
188
+ - every_day_irb is now a module that extends self
189
+ - specs for most of every_day_irb's functionality
190
+ - add helper method for paging output with hirb: page
191
+ - version bumps, including wirb and fancy_irb
192
+ - remove sketches dependency, it's a great gem, but very similar to interactive_editor
193
+ - Object#mlp alias for method_lookup_path
167
194
 
168
195
  ## 1.3.0 == 1.2.3
169
- * add modern debundle note
170
- * remove loading of .railsrc
171
- * remove dbg method
172
- * version bumps
196
+
197
+ - add modern debundle note
198
+ - remove loading of .railsrc
199
+ - remove dbg method
200
+ - version bumps
173
201
 
174
202
  ## 1.2.2
175
- * fix errors when inspect returns nil (e.g. CarrierWave uploaders)
176
- * create legacy branch for 1.8.7 support
203
+
204
+ - fix errors when inspect returns nil (e.g. CarrierWave uploaders)
205
+ - create legacy branch for 1.8.7 support
177
206
 
178
207
  ## 1.2.1
179
- * fix newboson loader issue
180
- * minor version bumps
208
+
209
+ - fix newboson loader issue
210
+ - minor version bumps
181
211
 
182
212
  ## 1.2.0
183
- * version bumps: hirb, awesome_print, coderay, g, methodfinder, method_source
184
- * remove RVM helpers: Sorry, were too buggy...
185
- * fix/improve 'cd' helper method
186
- * improve readme
187
- * move looksee gem to irbtools-more
188
- * more little tweaks
213
+
214
+ - version bumps: hirb, awesome_print, coderay, g, methodfinder, method_source
215
+ - remove RVM helpers: Sorry, were too buggy...
216
+ - fix/improve 'cd' helper method
217
+ - improve readme
218
+ - move looksee gem to irbtools-more
219
+ - more little tweaks
189
220
 
190
221
  ## 1.1.1
191
- * fix the Ripl.after_rc bug
222
+
223
+ - fix the Ripl.after_rc bug
192
224
 
193
225
  ## 1.1.0
194
- * fix hirb loading/unicode issue + colorize tables (thanks to halan)
195
- * colorize paged wirb output
196
- * include method locator gem (improved ancestors)
197
- * include looksee gem (aliased as Object#l/Object#ll and Object#edit)
198
- * include method source gem (Object#src)
199
- * small tweaks...
226
+
227
+ - fix hirb loading/unicode issue + colorize tables (thanks to halan)
228
+ - colorize paged wirb output
229
+ - include method locator gem (improved ancestors)
230
+ - include looksee gem (aliased as Object#l/Object#ll and Object#edit)
231
+ - include method source gem (Object#src)
232
+ - small tweaks...
200
233
 
201
234
  ## 1.0.6
202
- * add possibility to modify library callbacks without removing the library by using: replace_library_callback or add_library_callback
203
- * fix hirb dependency issue
204
- * readme improvements
235
+
236
+ - add possibility to modify library callbacks without removing the library by using: replace_library_callback or add_library_callback
237
+ - fix hirb dependency issue
238
+ - readme improvements
205
239
 
206
240
  ## 1.0.5
207
- * use paint gem for terminal colors
241
+
242
+ - use paint gem for terminal colors
208
243
 
209
244
  ## 1.0.4
210
- * improve error-handling
211
- * fix broken loading of boson + interactive_editor
245
+
246
+ - improve error-handling
247
+ - fix broken loading of boson + interactive_editor
212
248
 
213
249
  ## 1.0.3
214
- * fix post-install banner typo
250
+
251
+ - fix post-install banner typo
215
252
 
216
253
  ## 1.0.2
217
- * version bumps for zucker (rbx compatible) and wirb (improved generic object-description highlighting)
254
+
255
+ - version bumps for zucker (rbx compatible) and wirb (improved generic object-description highlighting)
218
256
 
219
257
  ## 1.0.1
220
- * add missing require 'rbconfig'
258
+
259
+ - add missing require 'rbconfig'
221
260
 
222
261
  ## 1.0.0
223
- * gemify general helpers/rvm stuff ("every_day_irb", "rvm_loader")
224
- * 6 different loading schemas: start, thread, autoload, sub_session, late, late_thread
225
- * load almost every feature via threads
226
- * don't use zucker/alias_for, autload zucker/env (except zucker/os) for performance reasons
227
- * add irbtools/minimal mode for starting Irbtools without the default set of libraries
228
- * replace RV and RE with rv and re
262
+
263
+ - gemify general helpers/rvm stuff ("every_day_irb", "rvm_loader")
264
+ - 6 different loading schemas: start, thread, autoload, sub_session, late, late_thread
265
+ - load almost every feature via threads
266
+ - don't use zucker/alias_for, autload zucker/env (except zucker/os) for performance reasons
267
+ - add irbtools/minimal mode for starting Irbtools without the default set of libraries
268
+ - replace RV and RE with rv and re
229
269
 
230
270
  ## 0.8.8
231
- * fix 0.8.7 file permissions
232
- * add methodfinder gem
233
- * don't depend on guessmethod anymore
271
+
272
+ - fix 0.8.7 file permissions
273
+ - add methodfinder gem
274
+ - don't depend on guessmethod anymore
234
275
 
235
276
  ## 0.8.7
236
- * fix railsrc loading
237
- * add ori gem for nice Object#ri calling
238
- * minor tweaks
277
+
278
+ - fix railsrc loading
279
+ - add ori gem for nice Object#ri calling
280
+ - minor tweaks
239
281
 
240
282
  ## 0.8.6
241
- * windows support
242
- * update hirb + activate unicode-drawn tables
283
+
284
+ - windows support
285
+ - update hirb + activate unicode-drawn tables
243
286
 
244
287
  ## 0.8.5
245
- * rails related fixes
288
+
289
+ - rails related fixes
246
290
 
247
291
  ## 0.8.4
248
- * now using wirb instead of wirble
292
+
293
+ - now using wirb instead of wirble
249
294
 
250
295
  ## 0.8.3
251
- * improved/added rvm methods (use, gemset, rubies, gemsets)
252
- * RVM (Ruby API) constant gets autoloaded
253
- * improved cd command
254
- * don't load guessmethod by default (it's cool, but not always suited for production)
255
- * more small changes
296
+
297
+ - improved/added rvm methods (use, gemset, rubies, gemsets)
298
+ - RVM (Ruby API) constant gets autoloaded
299
+ - improved cd command
300
+ - don't load guessmethod by default (it's cool, but not always suited for production)
301
+ - more small changes
256
302
 
257
303
  ## 0.8.2
258
- * only do irb specific features if in irb (ripl compatibility)
259
- * more generic shell_name (in welcome message)
304
+
305
+ - only do irb specific features if in irb (ripl compatibility)
306
+ - more generic shell_name (in welcome message)
260
307
 
261
308
  ## 0.8.1
262
- * rewrote irb_rocket: fancy_irb. No more workarounds needed, anymore.
263
- * added sketches gem
264
- * customizable welcome message
265
- * more little fixes/enhancements
309
+
310
+ - rewrote irb_rocket: fancy_irb. No more workarounds needed, anymore.
311
+ - added sketches gem
312
+ - customizable welcome message
313
+ - more little fixes/enhancements
266
314
 
267
315
  ## 0.8.0
268
- * added Object#ri method
269
- * feature: extension package loading (e.g. irbtools-more)
270
- * feature: loading in IRB.conf[:IRB_RC] (loading when a subirb starts, no more guessmethod rails errors)
271
- * added rerequire (rrq) and ld load helper
316
+
317
+ - added Object#ri method
318
+ - feature: extension package loading (e.g. irbtools-more)
319
+ - feature: loading in IRB.conf[:IRB_RC] (loading when a subirb starts, no more guessmethod rails errors)
320
+ - added rerequire (rrq) and ld load helper
272
321
 
273
322
  ## 0.7.4
274
- * added workaround to use irb_rocket and hirb at the same time (basic hack, e.g. paging does not work)
275
- * fixed little VERSION bug
323
+
324
+ - added workaround to use irb_rocket and hirb at the same time (basic hack, e.g. paging does not work)
325
+ - fixed little VERSION bug
276
326
 
277
327
  ## 0.7.3
278
- * refactored file structure and added new Irbtools.add_lib method
279
- * load railsrc if executed with rails and Irbtools.railsrc is set
280
- * more little fixes
328
+
329
+ - refactored file structure and added new Irbtools.add_lib method
330
+ - load railsrc if executed with rails and Irbtools.railsrc is set
331
+ - more little fixes
281
332
 
282
333
  ## 0.7.2
283
- * fixed Rails 3 bug
284
- * added boson gem (command repository)
285
- * remember history when resetting or switching ruby version
334
+
335
+ - fixed Rails 3 bug
336
+ - added boson gem (command repository)
337
+ - remember history when resetting or switching ruby version
286
338
 
287
339
  ## 0.7.1
288
- * added method for starting a debugger
340
+
341
+ - added method for starting a debugger
289
342
 
290
343
  ## 0.7.0
291
- * initial release
292
344
 
293
- J-_-L
345
+ - initial release
346
+
347
+ J-\_-L
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- irbtools (4.0.11)
4
+ irbtools (4.1.0)
5
5
  clipboard (>= 1.4, < 3.0)
6
6
  code (>= 0.9.4, < 2.0)
7
7
  coderay (~> 1.1)
@@ -11,7 +11,7 @@ PATH
11
11
  fancy_irb (~> 2.1)
12
12
  hirb (~> 0.7, >= 0.7.3)
13
13
  interactive_editor (~> 0.0, >= 0.0.12)
14
- irb (>= 1.12.0, < 1.15)
14
+ irb (>= 1.13.0, < 1.15)
15
15
  looksee (~> 5.0)
16
16
  methodfinder (~> 2.2, >= 2.2.5)
17
17
  object_shadow (~> 1.1)
@@ -24,7 +24,7 @@ PATH
24
24
  GEM
25
25
  remote: https://rubygems.org/
26
26
  specs:
27
- cd (1.0.1)
27
+ cd (1.0.2)
28
28
  clipboard (2.0.0)
29
29
  code (0.9.4)
30
30
  coderay (~> 1.1)
@@ -34,58 +34,56 @@ GEM
34
34
  yard (~> 0.9.11)
35
35
  debugging (2.1.0)
36
36
  paint (>= 0.9, < 3.0)
37
- diff-lcs (1.5.0)
37
+ diff-lcs (1.5.1)
38
38
  every_day_irb (2.2.0)
39
39
  cd (~> 1.0)
40
40
  fancy_irb (2.1.2)
41
41
  irb (>= 1.7, < 2.0)
42
42
  paint (>= 0.9, < 3.0)
43
43
  unicode-display_width (>= 2.5)
44
- ffi (1.15.5)
44
+ ffi (1.17.0)
45
45
  hirb (0.7.3)
46
46
  interactive_editor (0.0.12)
47
47
  spoon (~> 0.0.6)
48
48
  io-console (0.7.2)
49
- irb (1.12.0)
50
- rdoc
49
+ irb (1.14.1)
50
+ rdoc (>= 4.0.0)
51
51
  reline (>= 0.4.2)
52
52
  looksee (5.0.0)
53
- method_source (1.0.0)
53
+ method_source (1.1.0)
54
54
  methodfinder (2.2.5)
55
55
  object_shadow (1.1.1)
56
56
  os (1.1.4)
57
57
  paint (2.3.0)
58
58
  psych (5.1.2)
59
59
  stringio
60
- rake (13.0.6)
61
- rdoc (6.6.3.1)
60
+ rake (13.2.1)
61
+ rdoc (6.7.0)
62
62
  psych (>= 4.0.0)
63
- reline (0.5.2)
63
+ reline (0.5.10)
64
64
  io-console (~> 0.5)
65
- rspec (3.12.0)
66
- rspec-core (~> 3.12.0)
67
- rspec-expectations (~> 3.12.0)
68
- rspec-mocks (~> 3.12.0)
69
- rspec-core (3.12.0)
70
- rspec-support (~> 3.12.0)
71
- rspec-expectations (3.12.1)
65
+ rspec (3.13.0)
66
+ rspec-core (~> 3.13.0)
67
+ rspec-expectations (~> 3.13.0)
68
+ rspec-mocks (~> 3.13.0)
69
+ rspec-core (3.13.1)
70
+ rspec-support (~> 3.13.0)
71
+ rspec-expectations (3.13.3)
72
72
  diff-lcs (>= 1.2.0, < 2.0)
73
- rspec-support (~> 3.12.0)
74
- rspec-mocks (3.12.1)
73
+ rspec-support (~> 3.13.0)
74
+ rspec-mocks (3.13.1)
75
75
  diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.12.0)
77
- rspec-support (3.12.0)
78
- ruby_engine (2.0.0)
79
- ruby_version (1.0.2)
76
+ rspec-support (~> 3.13.0)
77
+ rspec-support (3.13.1)
78
+ ruby_engine (2.0.3)
79
+ ruby_version (1.0.3)
80
80
  spoon (0.0.6)
81
81
  ffi
82
- stringio (3.1.0)
83
- unicode-display_width (2.5.0)
84
- webrick (1.7.0)
82
+ stringio (3.1.1)
83
+ unicode-display_width (2.6.0)
85
84
  wirb (2.2.2)
86
85
  paint (>= 0.9, < 3.0)
87
- yard (0.9.28)
88
- webrick (~> 1.7.0)
86
+ yard (0.9.37)
89
87
 
90
88
  PLATFORMS
91
89
  ruby
@@ -97,4 +95,4 @@ DEPENDENCIES
97
95
  rspec
98
96
 
99
97
  BUNDLED WITH
100
- 2.4.4
98
+ 2.5.20
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Irbtools [![[version]](https://badge.fury.io/rb/irbtools.svg)](https://badge.fury.io/rb/irbtools) [![[ci]](https://github.com/janlelis/irbtools/workflows/Test/badge.svg)](https://github.com/janlelis/irbtools/actions?query=workflow%3ATest)
1
+ # Irbtools [![[version]](https://badge.fury.io/rb/irbtools.svg)](https://badge.fury.io/rb/irbtools) [![[ci]](https://github.com/janlelis/irbtools/workflows/Test/badge.svg)](https://github.com/janlelis/irbtools/actions?query=workflow%3ATest)
2
2
 
3
3
  ## Irbtools 4 for Current IRB
4
4
 
@@ -8,12 +8,18 @@ The current version of Irbtools requires [IRB 1.12+](https://github.com/ruby/irb
8
8
 
9
9
  Improves Ruby's IRB with:
10
10
 
11
- - a default configuration
12
- - improved syntax highlighting of result objects
13
- - helpful commands for debugging and introspection
11
+ - a default configuration
12
+ - improved syntax highlighting of result objects
13
+ - helpful commands for debugging and introspection
14
14
 
15
15
  ## Examples
16
16
 
17
+ ### Call system commands with `$`
18
+
19
+ ```ruby
20
+ >> $ git status # displays current git status
21
+ ```
22
+
17
23
  ### Show lookup chain and method list grouped by visibility
18
24
 
19
25
  ```ruby
@@ -145,12 +151,6 @@ require(path)
145
151
  choose_from_list(question, list)
146
152
  ```
147
153
 
148
- ### Call system commands with `$`
149
-
150
- ```ruby
151
- >> $ git status # displays current git status
152
- ```
153
-
154
154
  ## Setup
155
155
 
156
156
  $ gem install irbtools
@@ -169,7 +169,7 @@ your code with:
169
169
 
170
170
  binding.irb
171
171
 
172
- *Optional:* If the **binding_of_caller** gem is available, you can just call the `irb`
172
+ _Optional:_ If the **binding_of_caller** gem is available, you can just call the `irb`
173
173
  method and it will start a session with the current binding:
174
174
 
175
175
  irb
@@ -178,38 +178,38 @@ method and it will start a session with the current binding:
178
178
 
179
179
  ### General IRB Improvements
180
180
 
181
- - Syntax highlighting ([wirb](https://github.com/janlelis/wirb/) / [fancy_irb](https://github.com/janlelis/fancy_irb))
182
- - Loads included libraries efficiently to reduce IRB start-up time
183
- - Customizable views for specfic options using [hirb](https://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html). By default, ActiveRecord results get displayed as a table.
181
+ - Syntax highlighting ([wirb](https://github.com/janlelis/wirb/) / [fancy_irb](https://github.com/janlelis/fancy_irb))
182
+ - Loads included libraries efficiently to reduce IRB start-up time
183
+ - Customizable views for specfic options using [hirb](https://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html). By default, ActiveRecord results get displayed as a table.
184
184
 
185
185
  ### Included Debugging Methods for IRB
186
186
 
187
187
  #### Highlights
188
188
 
189
- - Lookup and manipulate instance variables / methods with ease using [object_shadow](https://github.com/janlelis/object_shadow/)
190
- - Go even further with [looksee](https://github.com/oggy/looksee), the best lookup path inspection tool out there
191
- - Display a method's source code using [code](https://github.com/janlelis/code)
192
- - Find methods that turn one value into another value with [methodfinder](https://github.com/citizen428/methodfinder)
193
- - [Use VIM from inside IRB](https://github.com/jberkel/interactive_editor)
189
+ - Lookup and manipulate instance variables / methods with ease using [object_shadow](https://github.com/janlelis/object_shadow/)
190
+ - Go even further with [looksee](https://github.com/oggy/looksee), the best lookup path inspection tool out there
191
+ - Display a method's source code using [code](https://github.com/janlelis/code)
192
+ - Find methods that turn one value into another value with [methodfinder](https://github.com/citizen428/methodfinder)
193
+ - [Use VIM from inside IRB](https://github.com/jberkel/interactive_editor)
194
194
 
195
195
  #### Extra Commands
196
196
 
197
197
  Commands get treated specially by IRB and do not necessarily follow Ruby syntax.
198
198
 
199
- Command | Alias | Description | Example
200
- ------ | ---------- | ---------|---
201
- `code ` | - | Shows syntax-highlighted source code of a method | `code Array#reverse`
202
- `howtocall ` | - | Shows the method signature | `howtocall String#gsub`
203
- `look ` | - | Shows looksee method list | `look [1,2,3]`
204
- `shadow ` | `+ ` | Shows object shadow method list | `shadow [1,2,3]`
205
- `sys ` | `$ ` | Calls system shell | `$ top`
199
+ | Command | Alias | Description | Example |
200
+ | ------------ | ----- | ------------------------------------------------ | ----------------------- |
201
+ | `code ` | - | Shows syntax-highlighted source code of a method | `code Array#reverse` |
202
+ | `howtocall ` | - | Shows the method signature | `howtocall String#gsub` |
203
+ | `look ` | - | Shows looksee method list | `look [1,2,3]` |
204
+ | `shadow ` | `+ ` | Shows object shadow method list | `shadow [1,2,3]` |
205
+ | `sys ` | `$ ` | Calls system shell | `$ top` |
206
206
 
207
207
  Two default commands have an additional alias:
208
208
 
209
- Command | Alias | Description | Example
210
- ------ | ---------- | ---------|---
211
- `show_doc` | `ri ` | Shows documentation | `ri String#gsub`
212
- `chws` | `co ` | "change into an object" | `co [1,2,3]`
209
+ | Command | Alias | Description | Example |
210
+ | ---------- | ----- | ----------------------- | ---------------- |
211
+ | `show_doc` | `ri ` | Shows documentation | `ri String#gsub` |
212
+ | `chws` | `co ` | "change into an object" | `co [1,2,3]` |
213
213
 
214
214
  ##### IRB's ls?
215
215
 
@@ -217,69 +217,69 @@ Please note that IRB's own **ls** command is aliased to `ils`, since `ls` alread
217
217
 
218
218
  #### Ruby Introspection
219
219
 
220
- Method / Constant | Arguments | Description | Provided By
221
- ------ | ---------- | -----------|-
222
- `Object#lp` or `Object#look` | | Supercharged method introspection in IRB | [looksee](https://github.com/oggy/looksee)
223
- `Object#shadow` | | Manipulate instance variables and learn about callable methods | [object_shadow](https://github.com/janlelis/object_shadow/)
224
- `code` | object = self, method_name | Display the method source with syntax highlighting. Will also try to look up C methods. | [code](https://github.com/janlelis/code)
225
- `howtocall` | object = self, method_or_proc | Display parameter names and types you will need to call a method | [debugging/howtocall](https://github.com/janlelis/debugging#howtocallobj--self-method_or_proc)
226
- `mf` | object1, object2 | Find methods which turn one value into another value | [methodfinder](https://github.com/citizen428/methodfinder)
220
+ | Method / Constant | Arguments | Description | Provided By |
221
+ | ---------------------------- | ----------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
222
+ | `Object#lp` or `Object#look` | | Supercharged method introspection in IRB | [looksee](https://github.com/oggy/looksee) |
223
+ | `Object#shadow` | | Manipulate instance variables and learn about callable methods | [object_shadow](https://github.com/janlelis/object_shadow/) |
224
+ | `code` | object = self, method_name | Display the method source with syntax highlighting. Will also try to look up C methods. | [code](https://github.com/janlelis/code) |
225
+ | `howtocall` | object = self, method_or_proc | Display parameter names and types you will need to call a method | [debugging/howtocall](https://github.com/janlelis/debugging#howtocallobj--self-method_or_proc) |
226
+ | `mf` | object1, object2 | Find methods which turn one value into another value | [methodfinder](https://github.com/citizen428/methodfinder) |
227
227
 
228
228
  #### Platform Info
229
229
 
230
- Method / Constant | Arguments | Description | Provided By
231
- ------ | ---------- | -----------|-
232
- `OS` | | Query operating system information | [os](https://github.com/rdp/os)
233
- `RubyVersion` | | Show the Ruby version | [ruby_version](https://github.com/janlelis/ruby_version)
234
- `RubyEngine` | | Show the Ruby engine | [ruby_engine](https://github.com/janlelis/ruby_engine)
230
+ | Method / Constant | Arguments | Description | Provided By |
231
+ | ----------------- | --------- | ---------------------------------- | -------------------------------------------------------- |
232
+ | `OS` | | Query operating system information | [os](https://github.com/rdp/os) |
233
+ | `RubyVersion` | | Show the Ruby version | [ruby_version](https://github.com/janlelis/ruby_version) |
234
+ | `RubyEngine` | | Show the Ruby engine | [ruby_engine](https://github.com/janlelis/ruby_engine) |
235
235
 
236
236
  #### General Utils
237
237
 
238
- Method / Constant | Arguments | Description | Provided By
239
- ------ | ---------- | -----------|-
240
- `beep` | | Ring terminal bell | [debugging/beep](https://github.com/janlelis/debugging#beep)
241
- `clear` | | Clear the terminal | [every_day_irb](https://github.com/janlelis/every_day_irb)
242
- `copy` | string | Copy something to the clipboard | [clipboard](https://github.com/janlelis/clipboard)
243
- `copy_output` | | Copy session output history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
244
- `colorize` | string | Syntax-highlight a string of Ruby code | [coderay](https://github.com/rubychan/coderay), irbtools
245
- `ed` / `emacs` / `mate` / `mvim` / `nano` / `vi` / `vim` | filename = nil | Start an editor in the session context | [interactive_editor](https://github.com/jberkel/interactive_editor)
246
- `ld` | file | Shortcut for `load lib.to_s + '.rb'` | [every_day_irb](https://github.com/janlelis/every_day_irb)
247
- `pa` | string, color | Print a string in the specified color | [paint](https://github.com/janlelis/paint#utilities)
248
- `page` | what, options = {} | Use pager to improve viewing longer content | [hirb](https://github.com/cldwalker/hirb#pager), irbtools
249
- `paste` | | Paste clipboard content | [clipboard](https://github.com/janlelis/clipboard)
250
- `q` | *args | Like `Kernel#p`, but prints results on one line, with different colors | [debugging/q](https://github.com/janlelis/debugging#qargs)
251
- `re` | string, regexg, groups = nil | Regex debugging helper | [debugging/re](https://github.com/janlelis/debugging#qargs)
252
- `reset!` | | Restart the current IRB session | [every_day_irb](https://github.com/janlelis/every_day_irb)
253
- `rq` | lib | Shortcut for `require lib.to_s`. Use it like this: `rq:prime` | [every_day_irb](https://github.com/janlelis/every_day_irb)
254
- `rr` | lib | Shortcut for `require_relative lib.to_s` | [every_day_irb](https://github.com/janlelis/every_day_irb)
255
- `rrq` / `rerequire` | lib | Hack to remove a library from `$LOADED_FEATURES` and `require` it again | [every_day_irb](https://github.com/janlelis/every_day_irb)
256
- `wp` | inspect_string | Syntax-highlight a Ruby return value | [wirb](https://github.com/janlelis/wirb#kernelwp)
238
+ | Method / Constant | Arguments | Description | Provided By |
239
+ | -------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
240
+ | `beep` | | Ring terminal bell | [debugging/beep](https://github.com/janlelis/debugging#beep) |
241
+ | `clear` | | Clear the terminal | [every_day_irb](https://github.com/janlelis/every_day_irb) |
242
+ | `copy` | string | Copy something to the clipboard | [clipboard](https://github.com/janlelis/clipboard) |
243
+ | `copy_output` | | Copy session output history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools |
244
+ | `colorize` | string | Syntax-highlight a string of Ruby code | [coderay](https://github.com/rubychan/coderay), irbtools |
245
+ | `ed` / `emacs` / `mate` / `mvim` / `nano` / `vi` / `vim` | filename = nil | Start an editor in the session context | [interactive_editor](https://github.com/jberkel/interactive_editor) |
246
+ | `ld` | file | Shortcut for `load lib.to_s + '.rb'` | [every_day_irb](https://github.com/janlelis/every_day_irb) |
247
+ | `pa` | string, color | Print a string in the specified color | [paint](https://github.com/janlelis/paint#utilities) |
248
+ | `page` | what, options = {} | Use pager to improve viewing longer content | [hirb](https://github.com/cldwalker/hirb#pager), irbtools |
249
+ | `paste` | | Paste clipboard content | [clipboard](https://github.com/janlelis/clipboard) |
250
+ | `q` | \*args | Like `Kernel#p`, but prints results on one line, with different colors | [debugging/q](https://github.com/janlelis/debugging#qargs) |
251
+ | `re` | string, regexg, groups = nil | Regex debugging helper | [debugging/re](https://github.com/janlelis/debugging#qargs) |
252
+ | `reset!` | | Restart the current IRB session | [every_day_irb](https://github.com/janlelis/every_day_irb) |
253
+ | `rq` | lib | Shortcut for `require lib.to_s`. Use it like this: `rq:prime` | [every_day_irb](https://github.com/janlelis/every_day_irb) |
254
+ | `rr` | lib | Shortcut for `require_relative lib.to_s` | [every_day_irb](https://github.com/janlelis/every_day_irb) |
255
+ | `rrq` / `rerequire` | lib | Hack to remove a library from `$LOADED_FEATURES` and `require` it again | [every_day_irb](https://github.com/janlelis/every_day_irb) |
256
+ | `wp` | inspect_string | Syntax-highlight a Ruby return value | [wirb](https://github.com/janlelis/wirb#kernelwp) |
257
257
 
258
258
  #### Files and Navigation
259
259
 
260
- Method / Constant | Arguments | Description | Provided By
261
- ------ | ---------- | -----------|-
262
- `cat` | path | Read file contents | [every_day_irb](https://github.com/janlelis/every_day_irb)
263
- `cd` | path = nil | Change the directory. Can also be used in these forms: `~cd` (change to home directory), `-cd` (change to previous directory) | [cd](https://github.com/janlelis/cd)
264
- `chmod` | mode, path | Set file mode for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
265
- `chmod_R` | mode, path | Set file mode for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
266
- `chown` | user, group, path | Set file owner for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
267
- `chown_R` | user, group, path | Set file owner for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
268
- `cp` | source, destination | Copy file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
269
- `cp_r` | source, destination | Copy directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
270
- `ls` | path = "." | List directory content | [cd](https://github.com/janlelis/cd)
271
- `ln` | target, link | Create symlink (`ln`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
272
- `ln_s` | target, link | Create symlink (`ln -s`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
273
- `ln_sf` | target, link | Create symlink (`ln -sf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
274
- `mkdir` | path | Create a new directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
275
- `mkdir_p` | path | Create a new directory (with `-p` option) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
276
- `cp` | source, destination | Move file or directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
277
- `pwd` | | Return current directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
278
- `ray` | path | Syntax highlight a Ruby file | [coderay](https://github.com/rubychan/coderay), irbtools
279
- `rm` | path | Delete a file (`rm`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
280
- `rm_r` | path | Delete a file or directory (`rm -r`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
281
- `rm_rf` | path | Delete a file or directory, with force (`rm -rf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
282
- `rmdir` | path | Delete an empty directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
260
+ | Method / Constant | Arguments | Description | Provided By |
261
+ | ----------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
262
+ | `cat` | path | Read file contents | [every_day_irb](https://github.com/janlelis/every_day_irb) |
263
+ | `cd` | path = nil | Change the directory. Can also be used in these forms: `~cd` (change to home directory), `-cd` (change to previous directory) | [cd](https://github.com/janlelis/cd) |
264
+ | `chmod` | mode, path | Set file mode for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
265
+ | `chmod_R` | mode, path | Set file mode for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
266
+ | `chown` | user, group, path | Set file owner for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
267
+ | `chown_R` | user, group, path | Set file owner for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
268
+ | `cp` | source, destination | Copy file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
269
+ | `cp_r` | source, destination | Copy directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
270
+ | `ls` | path = "." | List directory content | [cd](https://github.com/janlelis/cd) |
271
+ | `ln` | target, link | Create symlink (`ln`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
272
+ | `ln_s` | target, link | Create symlink (`ln -s`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
273
+ | `ln_sf` | target, link | Create symlink (`ln -sf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
274
+ | `mkdir` | path | Create a new directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
275
+ | `mkdir_p` | path | Create a new directory (with `-p` option) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
276
+ | `cp` | source, destination | Move file or directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
277
+ | `pwd` | | Return current directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
278
+ | `ray` | path | Syntax highlight a Ruby file | [coderay](https://github.com/rubychan/coderay), irbtools |
279
+ | `rm` | path | Delete a file (`rm`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
280
+ | `rm_r` | path | Delete a file or directory (`rm -r`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
281
+ | `rm_rf` | path | Delete a file or directory, with force (`rm -rf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
282
+ | `rmdir` | path | Delete an empty directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html) |
283
283
 
284
284
  ### Advanced Tweaking
285
285
 
@@ -312,7 +312,8 @@ You can use **Irbtools** without colors/IRB extensions. To do so, put this into
312
312
  require 'irbtools/non_fancy'
313
313
  Irbtools.start
314
314
  ```
315
- ## J-_-L
316
315
 
317
- Copyright (c) 2010-2023 Jan Lelis <https://janlelis.com> released under the MIT
316
+ ## J-\_-L
317
+
318
+ Copyright (c) 2010-2024 Jan Lelis <https://janlelis.com> released under the MIT
318
319
  license.
data/irbtools.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  # Dependencies
21
21
 
22
22
  # Core Functionality
23
- s.add_dependency %q<irb>, ">= 1.12.0", "< 1.15"
23
+ s.add_dependency %q<irb>, ">= 1.13.0", "< 1.15"
24
24
  s.add_dependency %q<every_day_irb>, "~> 2.2"
25
25
  s.add_dependency %q<fancy_irb>, "~> 2.1"
26
26
  s.add_dependency %q<wirb>, "~> 2.0", ">= 2.2.1"
@@ -1,31 +1,44 @@
1
- require "irb/command/base"
1
+ require "irb/command"
2
2
 
3
- module IRB
3
+ module Irbtools
4
4
  module Command
5
- class Code < Base
5
+ class Code < IRB::Command::Base
6
6
  category "Introspection"
7
7
  description "Shows the syntax-highlighted source code of a method"
8
+ help_message <<~HELP
9
+ Shows the syntax-highlighted source code of a method. Works with Ruby's
10
+ native methods.
8
11
 
9
- class << self
10
- def transform_args(args)
11
- if args.strip =~ /\A(?:([\w:]+)([#.]))?(\w+[?!]?)\z/
12
- if $1
13
- if $2 == "#"
14
- "#{$1}, #{$1}.instance_method(:#{$3})"
15
- else
16
- "#{$1}, :#{$3}"
17
- end
12
+ Example usages:
13
+ >> code SecureRandom.uuid
14
+ >> code Array#reverse
15
+ HELP
16
+
17
+ def transform_arg(arg)
18
+ if arg.empty?
19
+ "[]"
20
+ elsif arg.strip =~ /\A(?:([\w:]+)([#.]))?(\w+[?!]?)\z/
21
+ if $1
22
+ if $2 == "#"
23
+ "[#{$1}, #{$1}.instance_method(:#{$3})]"
18
24
  else
19
- ":" + $3
25
+ "[#{$1}, :#{$3}]"
20
26
  end
21
27
  else
22
- args
28
+ "[:#{$3}]"
23
29
  end
30
+ else
31
+ nil
24
32
  end
25
33
  end
26
34
 
27
- def execute(*args)
28
- @irb_context.workspace.binding.send(:code, *args)
35
+ def execute(arg)
36
+ if code_parameters_code = transform_arg(arg)
37
+ code_parameters = @irb_context.workspace.binding.eval(code_parameters_code)
38
+ @irb_context.workspace.binding.send(:code, *code_parameters)
39
+ else
40
+ warn "code: Please use rdoc syntax, e.g. Array#sum"
41
+ end
29
42
  rescue NameError
30
43
  warn "code: Class or method not found."
31
44
  end
@@ -1,31 +1,44 @@
1
- require "irb/command/base"
1
+ require "irb/command"
2
2
 
3
- module IRB
3
+ module Irbtools
4
4
  module Command
5
- class Howtocall < Base
5
+ class Howtocall < IRB::Command::Base
6
6
  category "Introspection"
7
7
  description "Displays method signatures based on Method#parameters"
8
+ help_message <<~HELP
9
+ Displays method signatures based on Method#parameters, with the same limitations,
10
+ so it's more useful with methods implemented in Ruby itself
8
11
 
9
- class << self
10
- def transform_args(args)
11
- if args.strip =~ /\A(?:([\w:]+)([#.]))?(\w+[?!]?)\z/
12
- if $1
13
- if $2 == "#"
14
- "#{$1}, #{$1}.instance_method(:#{$3})"
15
- else
16
- "#{$1}, :#{$3}"
17
- end
12
+ Example usages:
13
+ >> howtocall Gem.add_to_load_path
14
+ >> howtocall Array#sum
15
+ HELP
16
+
17
+ def transform_arg(arg)
18
+ if arg.empty?
19
+ "[]"
20
+ elsif arg.strip =~ /\A(?:([\w:]+)([#.]))?(\w+[?!]?)\z/
21
+ if $1
22
+ if $2 == "#"
23
+ "[#{$1}, #{$1}.instance_method(:#{$3})]"
18
24
  else
19
- ":" + $3
25
+ "[#{$1}, :#{$3}]"
20
26
  end
21
27
  else
22
- args
28
+ "[:#{$3}]"
23
29
  end
30
+ else
31
+ nil
24
32
  end
25
33
  end
26
34
 
27
- def execute(*args)
28
- @irb_context.workspace.binding.send(:howtocall, *args)
35
+ def execute(arg)
36
+ if howtocall_parameters_code = transform_arg(arg)
37
+ howtocall_parameters = @irb_context.workspace.binding.eval(howtocall_parameters_code)
38
+ @irb_context.workspace.binding.send(:howtocall, *howtocall_parameters)
39
+ else
40
+ warn "howtocall: Please use rdoc syntax, e.g. Array#sum"
41
+ end
29
42
  rescue NameError
30
43
  warn "howtocall: Class or method not found"
31
44
  end
@@ -1,20 +1,23 @@
1
- require "irb/command/base"
1
+ require "irb/command"
2
2
 
3
- module IRB
3
+ module Irbtools
4
4
  module Command
5
- class Look < Base
5
+ class Look < IRB::Command::Base
6
6
  category "Introspection"
7
- description 'Method list and lookup path inspection based on looksee gem'
7
+ description 'Method list and lookup path inspection based on the looksee gem'
8
+ help_message <<~HELP
9
+ Method list and lookup path inspection based on the looksee gem.
8
10
 
9
- def execute(*args)
10
- if args.empty?
11
- @irb_context.workspace.binding.look
11
+ Example usage: look [1,2,3]
12
+ HELP
13
+
14
+ def execute(arg)
15
+ if arg.strip.empty?
16
+ p @irb_context.workspace.binding.look
12
17
  else
13
- obj, *params = *args
14
- obj.look(*params)
18
+ p @irb_context.workspace.binding.eval(arg).look
15
19
  end
16
20
  end
17
21
  end
18
22
  end
19
23
  end
20
-
@@ -1,17 +1,21 @@
1
- require "irb/command/base"
1
+ require "irb/command"
2
2
 
3
- module IRB
3
+ module Irbtools
4
4
  module Command
5
- class Shadow < Base
5
+ class Shadow < IRB::Command::Base
6
6
  category "Introspection"
7
- description 'Method list and lookup path inspection based on object shadow gem'
7
+ description 'Method list and lookup path inspection based on the object shadow gem'
8
+ help_message <<~HELP
9
+ Method list and lookup path inspection based on the object shadow gem.
8
10
 
9
- def execute(*args)
10
- if args.empty?
11
- @irb_context.workspace.binding.shadow
11
+ Example usage: + [1,2,3]
12
+ HELP
13
+
14
+ def execute(arg)
15
+ if arg.strip.empty?
16
+ p @irb_context.workspace.binding.shadow
12
17
  else
13
- obj, *params = *args
14
- obj.shadow(*params)
18
+ p @irb_context.workspace.binding.eval(arg).shadow
15
19
  end
16
20
  end
17
21
  end
@@ -1,23 +1,18 @@
1
- require "irb/command/base"
1
+ require "irb/command"
2
2
 
3
- module IRB
3
+ module Irbtools
4
4
  module Command
5
- class Sys < Base
5
+ class Sys < IRB::Command::Base
6
6
  category "Misc"
7
7
  description 'Run a system command'
8
+ help_message <<~HELP
9
+ Run a command via Ruby's Kernel#system method
8
10
 
9
- class << self
10
- def transform_args(args)
11
- if args.empty? || string_literal?(args)
12
- args
13
- else
14
- args.strip.dump
15
- end
16
- end
17
- end
11
+ Example usage: $ cowsay "Hello from IRB"
12
+ HELP
18
13
 
19
- def execute(*args)
20
- system(*args)
14
+ def execute(arg)
15
+ system(arg)
21
16
  end
22
17
  end
23
18
  end
@@ -1,4 +1,5 @@
1
1
  require_relative 'version'
2
2
 
3
3
  require_relative 'implementation'
4
+ require_relative "commands"
4
5
  require_relative 'libraries' unless Irbtools.minimal
@@ -127,18 +127,11 @@ module Irbtools
127
127
  end
128
128
 
129
129
  def load_commands
130
- ec = IRB::ExtendCommandBundle.instance_variable_get(:@EXTEND_COMMANDS)
131
-
132
- [
133
- [:code, :Code, nil, [:code, IRB::ExtendCommandBundle::OVERRIDE_ALL]],
134
- [:howtocall, :Howtocall, nil, [:howtocall, IRB::ExtendCommandBundle::OVERRIDE_ALL]],
135
- [:look, :Look, nil, [:look, IRB::ExtendCommandBundle::OVERRIDE_ALL]],
136
- [:shadow, :Shadow, nil, [:shadow, IRB::ExtendCommandBundle::OVERRIDE_ALL]],
137
- [:sys, :Sys, nil, [:sys, IRB::ExtendCommandBundle::OVERRIDE_ALL]],
138
- ].each{ |ecconfig|
139
- ec.push(ecconfig)
140
- IRB::ExtendCommandBundle.def_extend_command(*ecconfig)
141
- }
130
+ IRB::Command.register(:code, Irbtools::Command::Code)
131
+ IRB::Command.register(:howtocall, Irbtools::Command::Howtocall)
132
+ IRB::Command.register(:look, Irbtools::Command::Look)
133
+ IRB::Command.register(:shadow, Irbtools::Command::Shadow)
134
+ IRB::Command.register(:sys, Irbtools::Command::Sys)
142
135
  end
143
136
 
144
137
  def add_command_aliases
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Irbtools
4
- VERSION = "4.0.11"
4
+ VERSION = "4.1.0"
5
5
  end
data/lib/irbtools.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require_relative "irbtools/configure"
2
- require_relative "irbtools/commands"
3
2
 
4
3
  require "irb"
5
4
 
@@ -5,18 +5,18 @@ describe "irbtools commands" do
5
5
  describe "howtocall / code" do
6
6
  it "support ri Syntax like String.name or String#gsub" do
7
7
  expect(
8
- IRB::Command::Howtocall.transform_args("String.name")
9
- ).to eq "String, :name"
8
+ Irbtools::Command::Howtocall.new(nil).transform_arg("String.name")
9
+ ).to eq "[String, :name]"
10
10
 
11
11
  expect(
12
- IRB::Command::Code.transform_args("String#gsub")
13
- ).to eq "String, String.instance_method(:gsub)"
12
+ Irbtools::Command::Code.new(nil).transform_arg("String#gsub")
13
+ ).to eq "[String, String.instance_method(:gsub)]"
14
14
  end
15
15
 
16
16
  it "supports question-mark methods" do
17
17
  expect(
18
- IRB::Command::Howtocall.transform_args("String#ascii_only?")
19
- ).to eq "String, String.instance_method(:ascii_only?)"
18
+ Irbtools::Command::Howtocall.new(nil).transform_arg("String#ascii_only?")
19
+ ).to eq "[String, String.instance_method(:ascii_only?)]"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irbtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.11
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.12.0
19
+ version: 1.13.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.15'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.12.0
29
+ version: 1.13.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.15'
@@ -376,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
376
376
  - !ruby/object:Gem::Version
377
377
  version: '0'
378
378
  requirements: []
379
- rubygems_version: 3.5.9
379
+ rubygems_version: 3.5.20
380
380
  signing_key:
381
381
  specification_version: 4
382
382
  summary: Irbtools happy IRB.