irbtools-more 2.5.0 → 3.0.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: 33eccdc17f0ad6c02b061ee0e6d86151cfba85b114ab00598d4b6f37b05c869d
4
- data.tar.gz: f8ff565277fd6a6fe3e97c285757b13c8e5c4b7499f174f23e8aaa881fc782a7
3
+ metadata.gz: 972a79a9c907f8de3d0dedd992515463b45fba4ceac7a887b018b59193d4e815
4
+ data.tar.gz: 4dfa06b4dc2f07787cd6da80a401fdad5261bb59a7eb09a2df811741b60f7793
5
5
  SHA512:
6
- metadata.gz: d2531bc60fe1c8c738d48539cfff726afc56c6daaa4a4a7155b050b76e7585c939ab977734cad2e3df040293d1f6575879bfff2df0484ff1edd6960a0eae585b
7
- data.tar.gz: f45eda73b19b56a4b6bfcf6ea13588daf6f273ef2fba894dbb43f5e282aad3ab9dfbe44e45299eafab64545c2045f99e362188b1031b96937ad1b66d7733dd60
6
+ metadata.gz: 4734da3de183cec7f5050dfbc30a7b89eb23019fa0465a55d30cadca53481a3869b59a942f2a2a78520f8f3074db6698703a55ac49a1123f935695bbfc000eed
7
+ data.tar.gz: 22465208a0e01771d05c9912b9d3cb10a124e07d8b5de6ca1de325d69fe2af1e4c717588cd069369e7c2c8279505e71c104d2342c8221b51b1284668a2f5e535
data/CHANGELOG-MORE.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Irbtools (More) Changelog
2
2
 
3
+ ## 3.0 (final)
4
+
5
+ Retire irbtools-more:
6
+
7
+ * Move looksee to core irbtools
8
+ * Move core_docs to core irbtools
9
+ * Remove bond (outdated)
10
+ * Leave binding_of_caller optional
11
+
3
12
  ## 2.5.0
4
13
  * Bump binding_of_caller & core_docs for Ruby 3.0
5
14
 
data/MIT-LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2020 Jan Lelis
1
+ Copyright (c) 2010-2022 Jan Lelis
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,21 +1,156 @@
1
- # Irbtools [![version](https://badge.fury.io/rb/irbtools.svg)](https://badge.fury.io/rb/irbtools) [![[travis]](https://travis-ci.org/janlelis/irbtools.svg)](https://travis-ci.org/janlelis/irbtools)
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
+
3
+ ## Irbtools 4.0 for IRB 1.6+
4
+
5
+ The current version of Irbtools requires [IRB 1.6+](https://github.com/ruby/irb) (which is the default for Ruby
6
+ from 3.2 on). Please use Irbtools 3 for earlier versions of IRB.
7
+
8
+ ## Description
9
+
10
+ Improves Ruby's IRB with:
11
+
12
+ - a default configuration
13
+ - improved syntax highlighting of result objects
14
+ - helpful commands for debugging and introspection
15
+
16
+ ## Examples
17
+
18
+ ### Show lookup chain and method list grouped by visibility
2
19
 
3
20
  ```ruby
4
- _| _|
5
- _|_|_| _|_|_| _|_|_| _| _| _| _|_|_| _|
6
- _| _| _| _| _| _|_|_|_| _|_| _|_| _| _|_|_| _| _| _|
7
- _| _|_|_| _|_|_| _| _| _| _| _| _| _|_| _| _|_| _|
8
- _| _| _| _| _| _| _| _| _| _| _| _|_| _| _| _|
9
- _|_|_| _| _| _|_|_| _| _|_| _|_| _|_| _| _|_|_| _| _|_|_| _|
10
- _| _|
21
+ >> shadow [1,2,3].reverse
22
+ => # ObjectShadow of Object #85280
23
+
24
+ ## Lookup Chain
25
+
26
+ [#<Class:#<Array:0x00007fccd9cfac30>>, Array, Enumerable, Object, "…"]
27
+
28
+ ## 141 Public Methods (Non-Class/Object)
29
+
30
+ [:&, :*, :+, :-, :<<, :<=>, :==, :[], :[]=, :all?, :any?, :append, :assoc, :at, :bsearch, :bsearch_index, :chain,
31
+ :chunk, :chunk_while, :clear, :collect, :collect!, :collect_concat, :combination, :compact, :compact!, :concat,
32
+ :count, :cycle, :deconstruct, :delete, :delete_at, :delete_if, :detect, :difference, :dig, :drop, :drop_while,
33
+ :each, :each_cons, :each_entry, :each_index, :each_slice, :each_with_index, :each_with_object, :empty?, :entries,
34
+ :eql?, :fetch, :fill, :filter, :filter!, :filter_map, :find, :find_all, :find_index, :first, :flat_map, :flatten,
35
+ :flatten!, :grep, :grep_v, :group_by, :hash, :include?, :index, :inject, :insert, :inspect, :intersect?,
36
+ :intersection, :join, :keep_if, :last, :lazy, :length, :map, :map!, :max, :max_by, :member?, :min, :min_by,
37
+ :minmax, :minmax_by, :none?, :one?, :pack, :partition, :permutation, :pop, :prepend, :product, :push, :rassoc,
38
+ :reduce, :reject, :reject!, :repeated_combination, :repeated_permutation, :replace, :reverse, :reverse!,
39
+ :reverse_each, :rindex, :rotate, :rotate!, :sample, :select, :select!, :shelljoin, :shift, :shuffle, :shuffle!,
40
+ :size, :slice, :slice!, :slice_after, :slice_before, :slice_when, :sort, :sort!, :sort_by, :sort_by!, :sum,
41
+ :take, :take_while, :tally, :to_a, :to_ary, :to_h, :to_s, :to_set, :transpose, :union, :uniq, :uniq!, :unshift,
42
+ :values_at, :zip, :|]
43
+
44
+ ## 2 Private Methods (Non-Class/Object)
45
+
46
+ [:initialize, :initialize_copy]
47
+
48
+ ## Object Inspect
49
+
50
+ [3, 2, 1]
11
51
  ```
12
52
 
13
- Improvements for Ruby's IRB console, like syntax highlighted output and a lot of
14
- debugging and introspection methods. Unlike with PRY, you are still in your
15
- normal IRB. It is designed to work out-of-the-box, so there is no reason to not
16
- use it!
53
+ ### Show a method list grouped by ancestors
17
54
 
18
- **Compatible with Ruby 2.7's new IRB**
55
+ ```ruby
56
+ >> look "str"
57
+ .
58
+ .
59
+ .
60
+ Comparable
61
+ < <= == > >= between? clamp
62
+ String
63
+ % crypt inspect squeeze!
64
+ * dedup intern start_with?
65
+ + delete length strip
66
+ +@ delete! lines strip!
67
+ -@ delete_prefix ljust sub
68
+ << delete_prefix! lstrip sub!
69
+ <=> delete_suffix lstrip! succ
70
+ .
71
+ .
72
+ .
73
+ ```
74
+
75
+ ### Show source code of a Ruby-based method
76
+
77
+ ```ruby
78
+ >> code SecureRandom.uuid
79
+ #
80
+ # /home/dan/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/random/formatter.rb:170
81
+ #
82
+ # Generate a random v4 UUID (Universally Unique IDentifier).
83
+ #
84
+ # require 'random/formatter'
85
+ #
86
+ # Random.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
87
+ # Random.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
88
+ # # or
89
+ # prng = Random.new
90
+ # prng.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
91
+ #
92
+ # The version 4 UUID is purely random (except the version).
93
+ # It doesn't contain meaningful information such as MAC addresses, timestamps, etc.
94
+ #
95
+ # The result contains 122 random bits (15.25 random bytes).
96
+ #
97
+ # See RFC4122[https://datatracker.ietf.org/doc/html/rfc4122] for details of UUID.
98
+ #
99
+ def uuid
100
+ ary = random_bytes(16).unpack("NnnnnN")
101
+ ary[2] = (ary[2] & 0x0fff) | 0x4000
102
+ ary[3] = (ary[3] & 0x3fff) | 0x8000
103
+ "%08x-%04x-%04x-%04x-%04x%08x" % ary
104
+ end
105
+ ```
106
+
107
+ ### Show source code of a natively implemented method
108
+
109
+ ```ruby
110
+ >> code Array#reverse
111
+ //
112
+ // https://github.com/ruby/ruby/blob/ruby_3_2/array.c#L3282
113
+ //
114
+ // Returns a new \Array with the elements of +self+ in reverse order:
115
+ //
116
+ // a = ['foo', 'bar', 'two']
117
+ // a1 = a.reverse
118
+ // a1 # => ["two", "bar", "foo"]
119
+ static VALUE
120
+ rb_ary_reverse_m(VALUE ary)
121
+ {
122
+ long len = RARRAY_LEN(ary);
123
+ VALUE dup = rb_ary_new2(len);
124
+
125
+ if (len > 0) {
126
+ const VALUE *p1 = RARRAY_CONST_PTR_TRANSIENT(ary);
127
+ VALUE *p2 = (VALUE *)RARRAY_CONST_PTR_TRANSIENT(dup) + len - 1;
128
+ do *p2-- = *p1++; while (--len > 0);
129
+ }
130
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
131
+ return dup;
132
+ }
133
+ ```
134
+
135
+ ### Find out method signatures (most useful for Ruby-based methods with keyword args)
136
+
137
+ ```ruby
138
+ >> howtocall require
139
+ require(path)
140
+ ```
141
+
142
+ ```ruby
143
+ >> require "rubygems/user_interaction"
144
+ >> ui = Gem::ConsoleUI.new
145
+ >> howtocall ui.choose_from_list
146
+ choose_from_list(question, list)
147
+ ```
148
+
149
+ ### Call system commands with `$`
150
+
151
+ ```ruby
152
+ >> $ git status # displays current git status
153
+ ```
19
154
 
20
155
  ## Setup
21
156
 
@@ -30,55 +165,66 @@ You also need to add irbtools to your project's `Gemfile`:
30
165
 
31
166
  gem 'irbtools', require: 'irbtools/binding'
32
167
 
33
- Then start IRB (with **Irbtools** loaded) from the terminal or directly from your code with:
168
+ Then start IRB (with **Irbtools** loaded) from the terminal or directly from
169
+ your code with:
34
170
 
35
171
  binding.irb
36
172
 
37
- ### Enable More Gems
38
-
39
- Some suggested gems will not be installed to ensure wider general support. For
40
- the full feature set, you can install **irbtools-more**. To do so, change your
41
- `.irbrc` to:
42
-
43
- require 'irbtools/more'
44
-
45
- and edit your `Gemfile` to read like this:
173
+ *Optional:* If the **binding_of_caller** gem is available, you can just call the `irb`
174
+ method and it will start a session with the current binding:
46
175
 
47
- gem 'irbtools-more', require: 'irbtools/binding'
176
+ irb
48
177
 
49
178
  ## Features
50
179
 
51
- ### Irbtools' IRB Improvements
180
+ ### General IRB Improvements
52
181
 
53
182
  - Syntax highlighting ([wirb](https://github.com/janlelis/wirb/) / [fancy_irb](https://github.com/janlelis/fancy_irb))
54
- - Loads included third party libraries effeciently
55
- - Customizable views for specfic options using [hirb](https://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html)
56
- - ActiveRecord results get displayed as a table
57
- - **(irbtools-more)** [Improved tab-completion](https://tagaholic.me/bond/)
183
+ - Loads included libraries efficiently to reduce IRB start-up time
184
+ - 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.
58
185
 
59
- ### Irbtools' Included Methods for IRB
186
+ ### Included Debugging Methods for IRB
60
187
 
61
188
  #### Highlights
62
189
 
63
190
  - Lookup and manipulate instance variables / methods with ease using [object_shadow](https://github.com/janlelis/object_shadow/)
64
- - **(irbtools-more)** Go even further with [looksee](https://github.com/oggy/looksee), the best lookup path inspection tool out there
191
+ - Go even further with [looksee](https://github.com/oggy/looksee), the best lookup path inspection tool out there
65
192
  - Display a method's source code using [code](https://github.com/janlelis/code)
66
- - Inline access to *ri* docs by [ori](https://github.com/dadooda/ori)
67
- - If you have deactivated *ri*, you can re-generate the docs with something like: `rvm docs generate-ri`
68
193
  - Find methods that turn one value into another value with [methodfinder](https://github.com/citizen428/methodfinder)
69
194
  - [Use VIM from inside IRB](https://github.com/jberkel/interactive_editor)
70
195
 
196
+ #### Extra Commands
197
+
198
+ Commands get treated specially by IRB and do not necessarily follow Ruby syntax.
199
+
200
+ Command | Alias | Description | Example
201
+ ------ | ---------- | ---------|---
202
+ `code ` | - | Shows syntax-highlighted source code of a method | `code Array#reverse`
203
+ `howtocall ` | - | Shows the method signature | `howtocall String#gsub`
204
+ `look ` | - | Shows looksee method list | `look [1,2,3]`
205
+ `shadow ` | `+ ` | Shows object shadow method list | `shadow [1,2,3]`
206
+ `sys ` | `$ ` | Calls system shell | `$ top`
207
+
208
+ Two default commands have an additional alias:
209
+
210
+ Command | Alias | Description | Example
211
+ ------ | ---------- | ---------|---
212
+ `show_doc` | `ri ` | Shows documentation | `ri String#gsub`
213
+ `chws` | `co ` | "change into an object" | `co [1,2,3]`
214
+
215
+ ##### IRB's ls?
216
+
217
+ Please note that IRB's own **ls** command is aliased to `ils`, since `ls` already refers to a method listing all files in the current directory. If you haven't tried looksee (`look`) or object shadows (`shadow`) - give it a try ;)
218
+
71
219
  #### Ruby Introspection
72
220
 
73
221
  Method / Constant | Arguments | Description | Provided By
74
222
  ------ | ---------- | -----------|-
75
- `code` | object = self, method_name | Display the method source with syntax highlighting. Will also look up C methods if the **core_docs** gem (which is included in **irbtools-more**) is available. | [code](https://github.com/janlelis/code)
223
+ `Object#lp` or `Object#look` | | Supercharged method introspection in IRB | [looksee](https://github.com/oggy/looksee)
224
+ `Object#shadow` | | Manipulate instance variables and learn about callable methods | [object_shadow](https://github.com/janlelis/object_shadow/)
225
+ `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)
76
226
  `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)
77
227
  `mf` | object1, object2 | Find methods which turn one value into another value | [methodfinder](https://github.com/citizen428/methodfinder)
78
- `mof` | object, depth = 0, grep = // | Print a method list, ordered by modules (looksee lite) | [debugging](https://github.com/janlelis/debugging#mofobj-depth--nil)
79
- `Object#lp` | | **(irbtools-more)** Supercharged method introspection in IRB | [looksee](https://github.com/oggy/looksee)
80
- `Object#ri` | *args | Show ri documentation for this object or method | [ori](https://github.com/dadooda/ori)
81
- `Object#shadow` | | Manipulate instance variables and learn about callable methods | [object_shadow](https://github.com/janlelis/object_shadow/)
82
228
 
83
229
  #### Platform Info
84
230
 
@@ -87,14 +233,15 @@ Method / Constant | Arguments | Description | Provided By
87
233
  `OS` | | Query operating system information | [os](https://github.com/rdp/os)
88
234
  `RubyVersion` | | Show the Ruby version | [ruby_version](https://github.com/janlelis/ruby_version)
89
235
  `RubyEngine` | | Show the Ruby engine | [ruby_engine](https://github.com/janlelis/ruby_engine)
90
- `RubyInfo` | | List general information about the Ruby environment | [ruby_info](https://github.com/janlelis/ruby_info)
91
236
 
92
237
  #### General Utils
93
238
 
94
239
  Method / Constant | Arguments | Description | Provided By
95
240
  ------ | ---------- | -----------|-
96
241
  `beep` | | Ring terminal bell | [debugging/beep](https://github.com/janlelis/debugging#beep)
242
+ `clear` | | Clear the terminal | [every_day_irb](https://github.com/janlelis/every_day_irb)
97
243
  `copy` | string | Copy something to the clipboard | [clipboard](https://github.com/janlelis/clipboard)
244
+ `copy_output` | | Copy session output history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
98
245
  `colorize` | string | Syntax-highlight a string of Ruby code | [coderay](https://github.com/rubychan/coderay), irbtools
99
246
  `ed` / `emacs` / `mate` / `mvim` / `nano` / `vi` / `vim` | filename = nil | Start an editor in the session context | [interactive_editor](https://github.com/jberkel/interactive_editor)
100
247
  `ld` | file | Shortcut for `load lib.to_s + '.rb'` | [every_day_irb](https://github.com/janlelis/every_day_irb)
@@ -103,21 +250,12 @@ Method / Constant | Arguments | Description | Provided By
103
250
  `paste` | | Paste clipboard content | [clipboard](https://github.com/janlelis/clipboard)
104
251
  `q` | *args | Like `Kernel#p`, but prints results on one line, with different colors | [debugging/q](https://github.com/janlelis/debugging#qargs)
105
252
  `re` | string, regexg, groups = nil | Regex debugging helper | [debugging/re](https://github.com/janlelis/debugging#qargs)
253
+ `reset!` | | Restart the current IRB session | [every_day_irb](https://github.com/janlelis/every_day_irb)
106
254
  `rq` | lib | Shortcut for `require lib.to_s`. Use it like this: `rq:prime` | [every_day_irb](https://github.com/janlelis/every_day_irb)
107
255
  `rr` | lib | Shortcut for `require_relative lib.to_s` | [every_day_irb](https://github.com/janlelis/every_day_irb)
108
256
  `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)
109
257
  `wp` | inspect_string | Syntax-highlight a Ruby return value | [wirb](https://github.com/janlelis/wirb#kernelwp)
110
258
 
111
- #### IRB Support
112
-
113
- Method / Constant | Arguments | Description | Provided By
114
- ------ | ---------- | -----------|-
115
- `clear` | | Clear the terminal | [every_day_irb](https://github.com/janlelis/every_day_irb)
116
- `copy_input` | | Copy session history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
117
- `copy_output` | | Copy session output history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
118
- `reset!` | | Restart the current IRB session | [every_day_irb](https://github.com/janlelis/every_day_irb)
119
- `session_history` | number_of_lines = nil | Return a string of all commands issued in the current session | [every_day_irb](https://github.com/janlelis/every_day_irb)
120
-
121
259
  #### Files and Navigation
122
260
 
123
261
  Method / Constant | Arguments | Description | Provided By
@@ -130,7 +268,7 @@ Method / Constant | Arguments | Description | Provided By
130
268
  `chown_R` | user, group, path | Set file owner for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
131
269
  `cp` | source, destination | Copy file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
132
270
  `cp_r` | source, destination | Copy directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
133
- `ls` | path = "." | List directory content | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
271
+ `ls` | path = "." | List directory content | [cd](https://github.com/janlelis/cd)
134
272
  `ln` | target, link | Create symlink (`ln`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
135
273
  `ln_s` | target, link | Create symlink (`ln -s`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
136
274
  `ln_sf` | target, link | Create symlink (`ln -sf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
@@ -175,12 +313,7 @@ You can use **Irbtools** without colors/IRB extensions. To do so, put this into
175
313
  require 'irbtools/non_fancy'
176
314
  Irbtools.start
177
315
  ```
178
-
179
- ### Hint: Web Console and Other Approaches
180
-
181
- **Irbtools** works well together with the amazing [web-console!](https://github.com/rails/web-console), and also with the [ripl](https://github.com/cldwalker/ripl) IRB alternative.
182
-
183
316
  ## J-_-L
184
317
 
185
- Copyright (c) 2010-2020 Jan Lelis <https://janlelis.com> released under the MIT
318
+ Copyright (c) 2010-2022 Jan Lelis <https://janlelis.com> released under the MIT
186
319
  license.
@@ -8,12 +8,11 @@ Gem::Specification.new do |s|
8
8
  s.homepage = 'https://github.com/janlelis/irbtools'
9
9
  s.authors = ["Jan Lelis"]
10
10
  s.email = ["hi@ruby.consulting"]
11
- s.summary = 'irbtools-more adds bond and looksee to IRB.'
12
- s.description = 'irbtools-more extend irbtools with some extra functionality which requires a compile step, like the amazing looksee gem. Put `require "irbtools/more"` in the .irbrc file in your home directory to load irbtools together with irbtools/more'
11
+ s.summary = "irbtools-more not necessary anymore: Everything's now in core irbtools."
12
+ s.description = "irbtools-more not necessary anymore: looksee is now part of core irbtools and the other extensions have been removed (bond) or left optional (binding_of_caller)."
13
13
  s.files = %w[
14
14
  lib/irbtools/more.rb
15
15
  lib/irbtools/more/version.rb
16
- lib/bond/completions/irbtools.rb
17
16
  irbtools-more.gemspec
18
17
  ]
19
18
  s.extra_rdoc_files = %w[
@@ -21,13 +20,11 @@ Gem::Specification.new do |s|
21
20
  CHANGELOG-MORE.md
22
21
  MIT-LICENSE.txt
23
22
  ]
23
+ s.metadata = { "rubygems_mfa_required" => "true" }
24
24
  s.license = 'MIT'
25
25
 
26
- s.required_ruby_version = '>= 2.0', '< 4.0'
27
- s.add_dependency 'irbtools', '>= 2.2', '< 4.0'
28
- s.add_dependency 'bond', '~> 0.5'
29
- s.add_dependency 'looksee' , '~> 4.2'
30
- s.add_dependency 'core_docs', '>= 0.9.6'
31
- s.add_dependency 'binding_of_caller', '~> 1.0'
26
+ s.required_ruby_version = '>= 3.0', '< 4.0'
27
+ s.add_dependency 'irbtools', '~> 4.0'
28
+ s.post_install_message = "Notice (2022-12-29): irbtools-more is not necessary anymore. You can switch to just irbtools."
32
29
  end
33
30
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Irbtools
4
4
  module More
5
- VERSION = "2.5.0"
5
+ VERSION = "3.0.0"
6
6
  end
7
7
  end
data/lib/irbtools/more.rb CHANGED
@@ -4,19 +4,7 @@ require_relative 'more/version'
4
4
 
5
5
  require 'irbtools/configure'
6
6
 
7
- # Better auto-completion
8
- Irbtools.add_library :bond, thread: :more1 do
9
- Bond.start :gems => %w[irbtools]
10
- end
11
-
12
- begin
13
- # Object#l method for inspecting its lookup path
14
- Irbtools.add_library 'looksee', thread: :more2 do
15
- Looksee.rename :lp
16
- end
17
- rescue LoadError
18
- # do not load if not supported
19
- end
7
+ warn "irbtools-more is not necessary anymore, everything has been moved to irbtools (or removed)"
20
8
 
21
9
  # load now
22
10
  Irbtools.start if standalone
metadata CHANGED
@@ -1,94 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irbtools-more
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.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: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irbtools
15
15
  requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '2.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '4.0'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '2.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '4.0'
33
- - !ruby/object:Gem::Dependency
34
- name: bond
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '0.5'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '0.5'
47
- - !ruby/object:Gem::Dependency
48
- name: looksee
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '4.2'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
16
  requirements:
58
17
  - - "~>"
59
18
  - !ruby/object:Gem::Version
60
- version: '4.2'
61
- - !ruby/object:Gem::Dependency
62
- name: core_docs
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 0.9.6
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: 0.9.6
75
- - !ruby/object:Gem::Dependency
76
- name: binding_of_caller
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.0'
19
+ version: '4.0'
82
20
  type: :runtime
83
21
  prerelease: false
84
22
  version_requirements: !ruby/object:Gem::Requirement
85
23
  requirements:
86
24
  - - "~>"
87
25
  - !ruby/object:Gem::Version
88
- version: '1.0'
89
- description: irbtools-more extend irbtools with some extra functionality which requires
90
- a compile step, like the amazing looksee gem. Put `require "irbtools/more"` in the
91
- .irbrc file in your home directory to load irbtools together with irbtools/more
26
+ version: '4.0'
27
+ description: 'irbtools-more not necessary anymore: looksee is now part of core irbtools
28
+ and the other extensions have been removed (bond) or left optional (binding_of_caller).'
92
29
  email:
93
30
  - hi@ruby.consulting
94
31
  executables: []
@@ -102,14 +39,15 @@ files:
102
39
  - MIT-LICENSE.txt
103
40
  - README.md
104
41
  - irbtools-more.gemspec
105
- - lib/bond/completions/irbtools.rb
106
42
  - lib/irbtools/more.rb
107
43
  - lib/irbtools/more/version.rb
108
44
  homepage: https://github.com/janlelis/irbtools
109
45
  licenses:
110
46
  - MIT
111
- metadata: {}
112
- post_install_message:
47
+ metadata:
48
+ rubygems_mfa_required: 'true'
49
+ post_install_message: 'Notice (2022-12-29): irbtools-more is not necessary anymore.
50
+ You can switch to just irbtools.'
113
51
  rdoc_options: []
114
52
  require_paths:
115
53
  - lib
@@ -117,7 +55,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
55
  requirements:
118
56
  - - ">="
119
57
  - !ruby/object:Gem::Version
120
- version: '2.0'
58
+ version: '3.0'
121
59
  - - "<"
122
60
  - !ruby/object:Gem::Version
123
61
  version: '4.0'
@@ -127,8 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
65
  - !ruby/object:Gem::Version
128
66
  version: '0'
129
67
  requirements: []
130
- rubygems_version: 3.1.4
68
+ rubygems_version: 3.4.1
131
69
  signing_key:
132
70
  specification_version: 4
133
- summary: irbtools-more adds bond and looksee to IRB.
71
+ summary: 'irbtools-more not necessary anymore: Everything''s now in core irbtools.'
134
72
  test_files: []
@@ -1,97 +0,0 @@
1
- # # #
2
- # completion actions
3
-
4
- none = ->(*){ [] }
5
-
6
- send_completion = ->(e){
7
- if e.arguments.empty?
8
- [':']
9
- else
10
- e.object.methods.map(&:to_s) - Mission::OPERATORS
11
- end
12
- }
13
-
14
- public_send_completion = ->(e){
15
- if e.arguments.empty?
16
- [':']
17
- else
18
- e.object.public_methods.map(&:to_s) - Mission::OPERATORS
19
- end
20
- }
21
-
22
- directories = ->(e){
23
- if e.arguments.empty?
24
- ['"']
25
- else
26
- files(e).select{ |f| File.directory?(f) }
27
- end
28
- }
29
-
30
- files = ->(e){
31
- if e.arguments.empty?
32
- ['"']
33
- else
34
- files(e)
35
- end
36
- }
37
-
38
-
39
- ruby_files = ->(e){
40
- if e.arguments.empty?
41
- ['"']
42
- else
43
- Dir["./**/*.{rb,bundle,dll,so}"].map{ |f| f.sub('./', '') }.uniq
44
- end
45
- }
46
-
47
- ruby_files_with_load_path = ->(e){
48
- if e.arguments.empty?
49
- ['"']
50
- else
51
- ($:.flat_map{ |lf|
52
- Dir["#{lf}/**/*.{rb,bundle,dll,so}"].map{ |f| f.sub(lf + '/', '') }
53
- } + Gem.path.flat_map{ |gm|
54
- Dir["#{gm}/gems/*/lib/*.{rb,bundle,dll,so}"].map{ |f| f.sub(/^.*\//,'') }
55
- }).map{ |f| f.sub(/\.(?:rb|bundle|dll|so)$/, '') }.uniq
56
- end
57
- }
58
-
59
- # # #
60
- # base ruby
61
-
62
- complete method: "Object#send", &send_completion
63
- complete method: "Object#method", &send_completion
64
- complete method: "Object#public_method", &public_send_completion
65
- complete method: "Object#public_send", &public_send_completion
66
-
67
- complete method: "#require", search: :files, &ruby_files_with_load_path
68
- complete method: "#rq", search: :files, &ruby_files_with_load_path
69
- complete method: "#rerequire", search: :files, &ruby_files_with_load_path
70
- complete method: "#rrq", search: :files, &ruby_files_with_load_path
71
- complete method: "#require_relative", &ruby_files
72
- complete method: "#rr", &ruby_files
73
- complete method: "#load", &ruby_files
74
-
75
- # # #
76
- # irbtools
77
-
78
- # methods
79
- complete method: "#howtocall", &send_completion
80
- complete method: "#code", &send_completion
81
- complete method: "Object#ri", &send_completion
82
-
83
- # files
84
- complete method: "ls", &directories
85
- complete method: "cd", &directories
86
- complete method: "cat", &files
87
-
88
- # nops
89
- complete method: "#reset!", &none
90
- complete method: "#clear", &none
91
- complete method: "#beep", &none
92
- complete method: "#session_history", &none
93
- complete method: "#info", &none
94
- complete method: "#version", &none
95
- complete method: "#engine", &none
96
- complete method: "#os", &none
97
- complete method: "Object#lp", &none