irbtools 2.2.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{CHANGELOG.txt → CHANGELOG.md} +50 -40
- data/README.md +120 -134
- data/Rakefile +0 -10
- data/irbtools.gemspec +10 -12
- data/lib/irbtools/libraries.rb +12 -13
- data/lib/irbtools/version.rb +1 -1
- metadata +33 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a77f4b881fba5c72ded44b538e140b361d52703fc118bf2584ceaf96801e1a74
|
4
|
+
data.tar.gz: 2ff71cbd96d353fe1ee336c60972f1f9051665cdb48cf237573753e233492477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f64cc33563dd407aaeeec7292e3b37cc565a2c266e54d8f35506e268e63c39a6d4dbb1734cdd2ef2ff13fd6a0d22550d342e90f9de7f744b0406e0edc827075
|
7
|
+
data.tar.gz: fd1a78a26b3c4ed41e5fc9dbecbc3933215620f5276b7f62936858e3756bc4a157bdc7b7183ef70d433ad77fd04a5bf650ef03c007a1889a79b40c440e3d6312
|
@@ -1,14 +1,24 @@
|
|
1
|
-
|
1
|
+
# Irbtools Changelog
|
2
|
+
|
3
|
+
## 3.0.0
|
4
|
+
* Make IRB itself a dependency (default gem)
|
5
|
+
* Move: "Every day… IRB" into its own git repository
|
6
|
+
* https://github.com/janlelis/every_day_irb
|
7
|
+
* Replace instance and method_locator gems with new object_shadow gem
|
8
|
+
* Improve README
|
9
|
+
* Version bump code, clipboard, and methodfinder
|
10
|
+
|
11
|
+
## 2.2.2
|
2
12
|
* Remove Rails WIRB loading hack (no longer necessary)
|
3
13
|
|
4
|
-
2.2.1
|
14
|
+
## 2.2.1
|
5
15
|
* Allow os gem to be below 1.0
|
6
16
|
* Do not use binding.repl gem if Ruby version is at least 2.5
|
7
17
|
|
8
|
-
2.2.0
|
18
|
+
## 2.2.0
|
9
19
|
* Remove info, version, engine, and os methods. Use RubyInfo, RubyVersion, RubyEngine, and OS instead (fixes #40)
|
10
20
|
|
11
|
-
2.1.0
|
21
|
+
## 2.1.0
|
12
22
|
* Improve Rails compatibility
|
13
23
|
* Do not load instance gem in the context of Rails
|
14
24
|
* Make sure to actually require "irb" before using it
|
@@ -17,10 +27,10 @@
|
|
17
27
|
* Require new versions of fancy_irb, clipboard, os
|
18
28
|
* Set abort_on_exception to true for late threads (early threads do this implicitly via join)
|
19
29
|
|
20
|
-
2.0.1
|
30
|
+
## 2.0.1
|
21
31
|
* Remove g gem
|
22
32
|
|
23
|
-
2.0.0
|
33
|
+
## 2.0.0
|
24
34
|
* Use Wirb 2.0 and FancyIrb 1.0
|
25
35
|
* Drop support for Ruby 1
|
26
36
|
* Simplify starting from code via: require 'irbtools/binding'
|
@@ -34,35 +44,35 @@
|
|
34
44
|
* EveryDayIrb now gets released on its own, instead with every new irbtools version
|
35
45
|
* Improve documentation in Readme
|
36
46
|
|
37
|
-
1.7.1
|
47
|
+
## 1.7.1
|
38
48
|
* bump binding.repl, hirb, methodfinder
|
39
49
|
|
40
|
-
1.7.0
|
50
|
+
## 1.7.0
|
41
51
|
* bump boson, boson-more, binding.repl
|
42
52
|
* required ruby version: 1.9.3
|
43
53
|
* remove awesome_print
|
44
54
|
|
45
|
-
1.6.1
|
55
|
+
## 1.6.1
|
46
56
|
* don't load debugging/repl by default
|
47
57
|
* rename re method to engine and rv to version
|
48
58
|
|
49
|
-
1.6.0
|
59
|
+
## 1.6.0
|
50
60
|
* remove zucker dependency, but add debugging, ruby_version, ruby_engine, ruby_info and os gem
|
51
61
|
* configure binding.repl to load irb, not pry
|
52
62
|
* bump binding.repl, paint, wirb
|
53
63
|
|
54
|
-
1.5.1
|
64
|
+
## 1.5.1
|
55
65
|
* include binding.repl gem
|
56
66
|
* bump coderay, awesome_print, method_source, wirb
|
57
67
|
|
58
|
-
1.5.0
|
68
|
+
## 1.5.0
|
59
69
|
* update debundle hack
|
60
70
|
* load less zucker libraries
|
61
71
|
* add alias gem
|
62
72
|
* finaly load boson correctly (but don't load any boson plugin, yet), also depend on boson-more
|
63
73
|
* version bumps (zucker, clipboard, paint, hirb, wirb, ap, coderay, g)
|
64
74
|
|
65
|
-
1.4.0
|
75
|
+
## 1.4.0
|
66
76
|
* every_day_irb is now a module that extends self
|
67
77
|
* specs for most of every_day_irb's functionality
|
68
78
|
* add helper method for paging output with hirb: page
|
@@ -70,21 +80,21 @@
|
|
70
80
|
* remove sketches dependency, it's a great gem, but very similar to interactive_editor
|
71
81
|
* Object#mlp alias for method_lookup_path
|
72
82
|
|
73
|
-
1.3.0 == 1.2.3
|
83
|
+
## 1.3.0 == 1.2.3
|
74
84
|
* add modern debundle note
|
75
85
|
* remove loading of .railsrc
|
76
86
|
* remove dbg method
|
77
87
|
* version bumps
|
78
88
|
|
79
|
-
1.2.2
|
89
|
+
## 1.2.2
|
80
90
|
* fix errors when inspect returns nil (e.g. CarrierWave uploaders)
|
81
91
|
* create legacy branch for 1.8.7 support
|
82
92
|
|
83
|
-
1.2.1
|
93
|
+
## 1.2.1
|
84
94
|
* fix newboson loader issue
|
85
95
|
* minor version bumps
|
86
96
|
|
87
|
-
1.2.0
|
97
|
+
## 1.2.0
|
88
98
|
* version bumps: hirb, awesome_print, coderay, g, methodfinder, method_source
|
89
99
|
* remove RVM helpers: Sorry, were too buggy...
|
90
100
|
* fix/improve 'cd' helper method
|
@@ -92,10 +102,10 @@
|
|
92
102
|
* move looksee gem to irbtools-more
|
93
103
|
* more little tweaks
|
94
104
|
|
95
|
-
1.1.1
|
105
|
+
## 1.1.1
|
96
106
|
* fix the Ripl.after_rc bug
|
97
107
|
|
98
|
-
1.1.0
|
108
|
+
## 1.1.0
|
99
109
|
* fix hirb loading/unicode issue + colorize tables (thanks to halan)
|
100
110
|
* colorize paged wirb output
|
101
111
|
* include method locator gem (improved ancestors)
|
@@ -103,28 +113,28 @@
|
|
103
113
|
* include method source gem (Object#src)
|
104
114
|
* small tweaks...
|
105
115
|
|
106
|
-
1.0.6
|
116
|
+
## 1.0.6
|
107
117
|
* add possibility to modify library callbacks without removing the library by using: replace_library_callback or add_library_callback
|
108
118
|
* fix hirb dependency issue
|
109
119
|
* readme improvements
|
110
120
|
|
111
|
-
1.0.5
|
121
|
+
## 1.0.5
|
112
122
|
* use paint gem for terminal colors
|
113
123
|
|
114
|
-
1.0.4
|
124
|
+
## 1.0.4
|
115
125
|
* improve error-handling
|
116
126
|
* fix broken loading of boson + interactive_editor
|
117
127
|
|
118
|
-
1.0.3
|
128
|
+
## 1.0.3
|
119
129
|
* fix post-install banner typo
|
120
130
|
|
121
|
-
1.0.2
|
131
|
+
## 1.0.2
|
122
132
|
* version bumps for zucker (rbx compatible) and wirb (improved generic object-description highlighting)
|
123
133
|
|
124
|
-
1.0.1
|
134
|
+
## 1.0.1
|
125
135
|
* add missing require 'rbconfig'
|
126
136
|
|
127
|
-
1.0.0
|
137
|
+
## 1.0.0
|
128
138
|
* gemify general helpers/rvm stuff ("every_day_irb", "rvm_loader")
|
129
139
|
* 6 different loading schemas: start, thread, autoload, sub_session, late, late_thread
|
130
140
|
* load almost every feature via threads
|
@@ -132,67 +142,67 @@
|
|
132
142
|
* add irbtools/minimal mode for starting Irbtools without the default set of libraries
|
133
143
|
* replace RV and RE with rv and re
|
134
144
|
|
135
|
-
0.8.8
|
145
|
+
## 0.8.8
|
136
146
|
* fix 0.8.7 file permissions
|
137
147
|
* add methodfinder gem
|
138
148
|
* don't depend on guessmethod anymore
|
139
149
|
|
140
|
-
0.8.7
|
150
|
+
## 0.8.7
|
141
151
|
* fix railsrc loading
|
142
152
|
* add ori gem for nice Object#ri calling
|
143
153
|
* minor tweaks
|
144
154
|
|
145
|
-
0.8.6
|
155
|
+
## 0.8.6
|
146
156
|
* windows support
|
147
157
|
* update hirb + activate unicode-drawn tables
|
148
158
|
|
149
|
-
0.8.5
|
159
|
+
## 0.8.5
|
150
160
|
* rails related fixes
|
151
161
|
|
152
|
-
0.8.4
|
162
|
+
## 0.8.4
|
153
163
|
* now using wirb instead of wirble
|
154
164
|
|
155
|
-
0.8.3
|
165
|
+
## 0.8.3
|
156
166
|
* improved/added rvm methods (use, gemset, rubies, gemsets)
|
157
167
|
* RVM (Ruby API) constant gets autoloaded
|
158
168
|
* improved cd command
|
159
169
|
* don't load guessmethod by default (it's cool, but not always suited for production)
|
160
170
|
* more small changes
|
161
171
|
|
162
|
-
0.8.2
|
172
|
+
## 0.8.2
|
163
173
|
* only do irb specific features if in irb (ripl compatibility)
|
164
174
|
* more generic shell_name (in welcome message)
|
165
175
|
|
166
|
-
0.8.1
|
176
|
+
## 0.8.1
|
167
177
|
* rewrote irb_rocket: fancy_irb. No more workarounds needed, anymore.
|
168
178
|
* added sketches gem
|
169
179
|
* customizable welcome message
|
170
180
|
* more little fixes/enhancements
|
171
181
|
|
172
|
-
0.8.0
|
182
|
+
## 0.8.0
|
173
183
|
* added Object#ri method
|
174
184
|
* feature: extension package loading (e.g. irbtools-more)
|
175
185
|
* feature: loading in IRB.conf[:IRB_RC] (loading when a subirb starts, no more guessmethod rails errors)
|
176
186
|
* added rerequire (rrq) and ld load helper
|
177
187
|
|
178
|
-
0.7.4
|
188
|
+
## 0.7.4
|
179
189
|
* added workaround to use irb_rocket and hirb at the same time (basic hack, e.g. paging does not work)
|
180
190
|
* fixed little VERSION bug
|
181
191
|
|
182
|
-
0.7.3
|
192
|
+
## 0.7.3
|
183
193
|
* refactored file structure and added new Irbtools.add_lib method
|
184
194
|
* load railsrc if executed with rails and Irbtools.railsrc is set
|
185
195
|
* more little fixes
|
186
196
|
|
187
|
-
0.7.2
|
197
|
+
## 0.7.2
|
188
198
|
* fixed Rails 3 bug
|
189
199
|
* added boson gem (command repository)
|
190
200
|
* remember history when resetting or switching ruby version
|
191
201
|
|
192
|
-
0.7.1
|
202
|
+
## 0.7.1
|
193
203
|
* added method for starting a debugger
|
194
204
|
|
195
|
-
0.7.0
|
205
|
+
## 0.7.0
|
196
206
|
* initial release
|
197
207
|
|
198
208
|
J-_-L
|
data/README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
# Irbtools [![version](https://badge.fury.io/rb/irbtools.svg)](https://badge.fury.io/rb/irbtools)
|
2
|
-
|
3
|
-
_ _| | | |
|
4
|
-
| __| __ \ __| _ \ _ \ | __|
|
5
|
-
| | | | | ( | ( | | \__ \
|
6
|
-
___| _| _.__/ \__| \___/ \___/ _| ____/
|
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)
|
7
2
|
|
3
|
+
```ruby
|
4
|
+
_| _|
|
5
|
+
_|_|_| _|_|_| _|_|_| _| _| _| _|_|_| _|
|
6
|
+
_| _| _| _| _| _|_|_|_| _|_| _|_| _| _|_|_| _| _| _|
|
7
|
+
_| _|_|_| _|_|_| _| _| _| _| _| _| _|_| _| _|_| _|
|
8
|
+
_| _| _| _| _| _| _| _| _| _| _| _|_| _| _| _|
|
9
|
+
_|_|_| _| _| _|_|_| _| _|_| _|_| _|_| _| _|_|_| _| _|_|_| _|
|
10
|
+
_| _|
|
11
|
+
```
|
8
12
|
|
9
|
-
Improvements for Ruby's IRB console, like
|
13
|
+
Improvements for Ruby's IRB console, like syntax highlighted output and a lot of
|
10
14
|
debugging and introspection methods. Unlike with PRY, you are still in your
|
11
15
|
normal IRB. It is designed to work out-of-the-box, so there is no reason to not
|
12
16
|
use it!
|
@@ -20,126 +24,128 @@ just create a new one. Add the following content:
|
|
20
24
|
|
21
25
|
require 'irbtools'
|
22
26
|
|
23
|
-
You also need to add irbtools to your project's Gemfile
|
27
|
+
You also need to add irbtools to your project's `Gemfile`:
|
24
28
|
|
25
29
|
gem 'irbtools', require: 'irbtools/binding'
|
26
30
|
|
27
|
-
Then start IRB (with **Irbtools** loaded) from the
|
31
|
+
Then start IRB (with **Irbtools** loaded) from the terminal or directly from your code with:
|
28
32
|
|
29
33
|
binding.irb
|
30
34
|
|
31
|
-
|
32
|
-
|
33
|
-
irb
|
34
|
-
|
35
|
-
### More Improvements
|
35
|
+
### Enable More Gems
|
36
36
|
|
37
37
|
Some suggested gems will not be installed to ensure wider general support. For
|
38
|
-
the full feature set, you can
|
38
|
+
the full feature set, you can install **irbtools-more**. To do so, change your
|
39
39
|
`.irbrc` to:
|
40
40
|
|
41
41
|
require 'irbtools/more'
|
42
42
|
|
43
|
-
and edit your Gemfile to
|
43
|
+
and edit your `Gemfile` to read like this:
|
44
44
|
|
45
45
|
gem 'irbtools-more', require: 'irbtools/binding'
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
*
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
`
|
102
|
-
`
|
103
|
-
`
|
104
|
-
`
|
105
|
-
`
|
106
|
-
`
|
107
|
-
`
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
`
|
114
|
-
`
|
115
|
-
`
|
116
|
-
`
|
117
|
-
`
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
`
|
124
|
-
`
|
125
|
-
`
|
126
|
-
`
|
127
|
-
`
|
128
|
-
`
|
129
|
-
`
|
130
|
-
`
|
131
|
-
`
|
132
|
-
`
|
133
|
-
`
|
134
|
-
`
|
135
|
-
`
|
136
|
-
|
137
|
-
|
138
|
-
|
47
|
+
## Features
|
48
|
+
|
49
|
+
### Irbtools' IRB Improvements
|
50
|
+
|
51
|
+
- Syntax highlighting ([wirb](https://github.com/janlelis/wirb/) / [fancy_irb](https://github.com/janlelis/fancy_irb))
|
52
|
+
- Loads included third party libraries effeciently
|
53
|
+
- Customizable views for specfic options using [hirb](https://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html)
|
54
|
+
- ActiveRecord results get displayed as a table
|
55
|
+
- **(irbtools-more)** [Improved tab-completion](https://tagaholic.me/bond/)
|
56
|
+
|
57
|
+
### Irbtools' Included Methods for IRB
|
58
|
+
|
59
|
+
#### Highlights
|
60
|
+
|
61
|
+
- Lookup and manipulate instance variables / methods with ease using [object_shadow](https://github.com/janlelis/object_shadow/)
|
62
|
+
- **(irbtools-more)** Go even further with [looksee](https://github.com/oggy/looksee), the best lookup path inspection tool out there
|
63
|
+
- Display a method's source code using [code](https://github.com/janlelis/code)
|
64
|
+
- Inline access to *ri* docs by [ori](https://github.com/dadooda/ori)
|
65
|
+
- If you have deactivated *ri*, you can re-generate the docs with something like: `rvm docs generate-ri`
|
66
|
+
- Find methods that turn one value into another value with [methodfinder](https://github.com/citizen428/methodfinder)
|
67
|
+
- [Use VIM from inside IRB](https://github.com/jberkel/interactive_editor)
|
68
|
+
|
69
|
+
#### Ruby Introspection
|
70
|
+
|
71
|
+
Method / Constant | Arguments | Description | Provided By
|
72
|
+
------ | ---------- | -----------|-
|
73
|
+
`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)
|
74
|
+
`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)
|
75
|
+
`mf` | object1, object2 | Find methods which turn one value into another value | [methodfinder](https://github.com/citizen428/methodfinder)
|
76
|
+
`mof` | object, depth = 0, grep = // | Print a method list, ordered by modules (looksee lite) | [debugging](https://github.com/janlelis/debugging#mofobj-depth--nil)
|
77
|
+
`Object#lp` | | **(irbtools-more)** Supercharged method introspection in IRB | [looksee](https://github.com/oggy/looksee)
|
78
|
+
`Object#ri` | *args | Show ri documentation for this object or method | [ori](https://github.com/dadooda/ori)
|
79
|
+
`Object#shadow` | | Manipulate instance variables and learn about callable methods | [object_shadow](https://github.com/janlelis/object_shadow/)
|
80
|
+
|
81
|
+
#### Platform Info
|
82
|
+
|
83
|
+
Method / Constant | Arguments | Description | Provided By
|
84
|
+
------ | ---------- | -----------|-
|
85
|
+
`OS` | | Query operating system information | [os](https://github.com/rdp/os)
|
86
|
+
`RubyVersion` | | Show the Ruby version | [ruby_version](https://github.com/janlelis/ruby_version)
|
87
|
+
`RubyEngine` | | Show the Ruby engine | [ruby_engine](https://github.com/janlelis/ruby_engine)
|
88
|
+
`RubyInfo` | | List general information about the Ruby environment | [ruby_info](https://github.com/janlelis/ruby_info)
|
89
|
+
|
90
|
+
#### General Utils
|
91
|
+
|
92
|
+
Method / Constant | Arguments | Description | Provided By
|
93
|
+
------ | ---------- | -----------|-
|
94
|
+
`beep` | | Ring terminal bell | [debugging/beep](https://github.com/janlelis/debugging#beep)
|
95
|
+
`copy` | string | Copy something to the clipboard | [clipboard](https://github.com/janlelis/clipboard)
|
96
|
+
`colorize` | string | Syntax-highlight a string of Ruby code | [coderay](https://github.com/rubychan/coderay), irbtools
|
97
|
+
`ed` / `emacs` / `mate` / `mvim` / `nano` / `vi` / `vim` | filename = nil | Start an editor in the session context | [interactive_editor](https://github.com/jberkel/interactive_editor)
|
98
|
+
`ld` | file | Shortcut for `load lib.to_s + '.rb'` | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
99
|
+
`pa` | string, color | Print a string in the specified color | [paint](https://github.com/janlelis/paint#utilities)
|
100
|
+
`page` | what, options = {} | Use pager to improve viewing longer content | [hirb](https://github.com/cldwalker/hirb#pager), irbtools
|
101
|
+
`paste` | | Paste clipboard content | [clipboard](https://github.com/janlelis/clipboard)
|
102
|
+
`q` | *args | Like `Kernel#p`, but prints results on one line, with different colors | [debugging/q](https://github.com/janlelis/debugging#qargs)
|
103
|
+
`re` | string, regexg, groups = nil | Regex debugging helper | [debugging/re](https://github.com/janlelis/debugging#qargs)
|
104
|
+
`rq` | lib | Shortcut for `require lib.to_s`. Use it like this: `rq:prime` | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
105
|
+
`rr` | lib | Shortcut for `require_relative lib.to_s` | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
106
|
+
`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)
|
107
|
+
`wp` | inspect_string | Syntax-highlight a Ruby return value | [wirb](https://github.com/janlelis/wirb#kernelwp)
|
108
|
+
|
109
|
+
#### IRB Support
|
110
|
+
|
111
|
+
Method / Constant | Arguments | Description | Provided By
|
112
|
+
------ | ---------- | -----------|-
|
113
|
+
`clear` | | Clear the terminal | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
114
|
+
`copy_input` | | Copy session history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
|
115
|
+
`copy_output` | | Copy session output history to the clipboard | [clipboard](https://github.com/janlelis/clipboard), irbtools
|
116
|
+
`reset!` | | Restart the current IRB session | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
117
|
+
`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)
|
118
|
+
|
119
|
+
#### Files and Navigation
|
120
|
+
|
121
|
+
Method / Constant | Arguments | Description | Provided By
|
122
|
+
------ | ---------- | -----------|-
|
123
|
+
`cat` | path | Read file contents | [every_day_irb](https://github.com/janlelis/every_day_irb)
|
124
|
+
`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)
|
125
|
+
`chmod` | mode, path | Set file mode for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
126
|
+
`chmod_R` | mode, path | Set file mode for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
127
|
+
`chown` | user, group, path | Set file owner for file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
128
|
+
`chown_R` | user, group, path | Set file owner for directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
129
|
+
`cp` | source, destination | Copy file | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
130
|
+
`cp_r` | source, destination | Copy directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
131
|
+
`ls` | path = "." | List directory content | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
132
|
+
`ln` | target, link | Create symlink (`ln`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
133
|
+
`ln_s` | target, link | Create symlink (`ln -s`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
134
|
+
`ln_sf` | target, link | Create symlink (`ln -sf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
135
|
+
`mkdir` | path | Create a new directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
136
|
+
`mkdir_p` | path | Create a new directory (with `-p` option) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
137
|
+
`cp` | source, destination | Move file or directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
138
|
+
`pwd` | | Return current directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
139
|
+
`ray` | path | Syntax highlight a Ruby file | [coderay](https://github.com/rubychan/coderay), irbtools
|
140
|
+
`rm` | path | Delete a file (`rm`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
141
|
+
`rm_r` | path | Delete a file or directory (`rm -r`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
142
|
+
`rm_rf` | path | Delete a file or directory, with force (`rm -rf`) | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
143
|
+
`rmdir` | path | Delete an empty directory | [fileutils](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html)
|
144
|
+
|
145
|
+
### Advanced Tweaking
|
139
146
|
|
140
147
|
See [CONFIGURE.md](https://github.com/janlelis/irbtools/blob/master/CONFIGURE.md).
|
141
148
|
|
142
|
-
|
143
149
|
### Troubleshooting: ANSI colors on Windows
|
144
150
|
|
145
151
|
Windows: ANSI support can be enabled via
|
@@ -147,50 +153,30 @@ Windows: ANSI support can be enabled via
|
|
147
153
|
[ConEmu](https://conemu.github.io/) or
|
148
154
|
[WSL](https://docs.microsoft.com/en-us/windows/wsl/about).
|
149
155
|
|
150
|
-
|
151
156
|
### Troubleshooting: Clipboard not working on Linux
|
152
157
|
|
153
158
|
Clipboard support requires **xsel** or **xclip**. On ubuntu, do:
|
154
159
|
|
155
160
|
sudo apt-get install xsel
|
156
161
|
|
157
|
-
|
158
|
-
### Troubleshooting: Unicode causes wrong display widths
|
159
|
-
|
160
|
-
If you use double-width unicode characters, you will need to paste the
|
161
|
-
following snippet to your `~/.irbrc` file.
|
162
|
-
|
163
|
-
```ruby
|
164
|
-
Irbtools.replace_library_callback :fancy_irb do
|
165
|
-
FancyIrb.start east_asian_width: true
|
166
|
-
end
|
167
|
-
```
|
168
|
-
|
169
|
-
This setting is deactivated by default, because of performance issues.
|
170
|
-
|
171
|
-
|
172
162
|
### Hint: Debundle
|
173
163
|
|
174
|
-
If you do not want to add **Irbtools** to your project's Gemfile
|
164
|
+
If you do not want to add **Irbtools** to your project's `Gemfile`, you will need a
|
175
165
|
[debundle hack](https://github.com/janlelis/debundle.rb). Put it at the
|
176
|
-
beginning of your `~/.irbrc` file and you are fine
|
177
|
-
|
166
|
+
beginning of your `~/.irbrc` file and you are fine.
|
178
167
|
|
179
168
|
### Hint: No ANSI / IRB extension
|
180
169
|
|
181
|
-
You can use Irbtools without colors/
|
170
|
+
You can use **Irbtools** without colors/IRB extensions. To do so, put this into `~/.irbrc`:
|
182
171
|
|
183
172
|
```ruby
|
184
173
|
require 'irbtools/non_fancy'
|
185
174
|
Irbtools.start
|
186
175
|
```
|
187
176
|
|
177
|
+
### Hint: Web Console and Other Approaches
|
188
178
|
|
189
|
-
|
190
|
-
|
191
|
-
**Irbtools** works well together with the amazing
|
192
|
-
[web-console!](https://github.com/rails/web-console)
|
193
|
-
|
179
|
+
**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.
|
194
180
|
|
195
181
|
## J-_-L
|
196
182
|
|
data/Rakefile
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require "rspec/core/rake_task"
|
3
3
|
|
4
|
-
|
5
4
|
task :test => :spec
|
6
5
|
task :default => :spec
|
7
6
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
8
7
|
t.rspec_opts = '--backtrace --color'
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
|
-
def gemspec1
|
13
|
-
@gemspec1 ||= eval(File.read('every_day_irb.gemspec'), binding, 'every_day_irb.gemspec')
|
14
|
-
end
|
15
|
-
|
16
10
|
def gemspec2
|
17
11
|
@gemspec2 ||= eval(File.read('irbtools.gemspec'), binding, 'irbtools.gemspec')
|
18
12
|
end
|
@@ -23,25 +17,21 @@ end
|
|
23
17
|
|
24
18
|
desc "Build the gems"
|
25
19
|
task :gem => :gemspec do
|
26
|
-
sh "gem build #{gemspec1.name}.gemspec"
|
27
20
|
sh "gem build #{gemspec2.name}.gemspec"
|
28
21
|
sh "gem build #{gemspec3.name}.gemspec"
|
29
22
|
FileUtils.mkdir_p 'pkg'
|
30
|
-
FileUtils.mv "#{gemspec1.name}-#{gemspec1.version}.gem", 'pkg'
|
31
23
|
FileUtils.mv "#{gemspec2.name}-#{gemspec2.version}.gem", 'pkg'
|
32
24
|
FileUtils.mv "#{gemspec3.name}-#{gemspec3.version}.gem", 'pkg'
|
33
25
|
end
|
34
26
|
|
35
27
|
desc "Install the gem locally (without docs)"
|
36
28
|
task :install => :gem do
|
37
|
-
sh %{gem install pkg/#{gemspec1.name}-#{gemspec1.version}.gem --no-document}
|
38
29
|
sh %{gem install pkg/#{gemspec2.name}-#{gemspec2.version}.gem --no-document}
|
39
30
|
sh %{gem install pkg/#{gemspec3.name}-#{gemspec3.version}.gem --no-document}
|
40
31
|
end
|
41
32
|
|
42
33
|
desc "Validate the gemspec"
|
43
34
|
task :gemspec do
|
44
|
-
gemspec1.validate
|
45
35
|
gemspec2.validate
|
46
36
|
gemspec3.validate
|
47
37
|
end
|
data/irbtools.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.homepage = 'https://github.com/janlelis/irbtools'
|
9
9
|
s.authors = ["Jan Lelis"]
|
10
10
|
s.summary = 'Irbtools happy IRB.'
|
11
|
-
s.description = "Irbtools make Ruby's IRB more productive."
|
11
|
+
s.description = "Irbtools make working with Ruby's IRB console more productive."
|
12
12
|
s.email = 'mail@janlelis.de'
|
13
13
|
s.files = %w[
|
14
14
|
lib/irbtools.rb
|
@@ -26,40 +26,38 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.extra_rdoc_files = %w[
|
27
27
|
README.md
|
28
28
|
CONFIGURE.md
|
29
|
-
CHANGELOG.
|
29
|
+
CHANGELOG.md
|
30
30
|
MIT-LICENSE.txt
|
31
31
|
]
|
32
32
|
s.license = 'MIT'
|
33
33
|
|
34
34
|
s.required_ruby_version = '~> 2.0'
|
35
|
-
s.add_development_dependency 'rspec', '~> 3.2'
|
36
|
-
s.add_development_dependency 'rake', '~> 10.4'
|
37
35
|
|
38
36
|
# # #
|
39
37
|
# Dependencies
|
40
38
|
|
41
|
-
#
|
39
|
+
# Core Functionality
|
40
|
+
s.add_dependency %q<irb>, ">= 0.9.6"
|
42
41
|
s.add_dependency %q<every_day_irb>, "~> 2.0"
|
43
42
|
s.add_dependency %q<fancy_irb>, "~> 1.1"
|
44
43
|
s.add_dependency %q<wirb>, "~> 2.0"
|
45
44
|
s.add_dependency %q<hirb>, "~> 0.7", ">= 0.7.3"
|
46
45
|
s.add_dependency %q<binding.repl>, "~> 3.0"
|
47
46
|
|
48
|
-
#
|
47
|
+
# Utils
|
49
48
|
s.add_dependency %q<paint>, ">= 0.9", "< 3.0"
|
50
|
-
s.add_dependency %q<clipboard>, "~> 1.
|
49
|
+
s.add_dependency %q<clipboard>, "~> 1.3"
|
51
50
|
s.add_dependency %q<interactive_editor>, "~> 0.0", ">= 0.0.10"
|
52
51
|
s.add_dependency %q<coderay>, "~> 1.1"
|
53
52
|
s.add_dependency %q<debugging>, "~> 1.1"
|
54
53
|
|
55
|
-
#
|
56
|
-
s.add_dependency %q<
|
54
|
+
# Introspection / Docs
|
55
|
+
s.add_dependency %q<object_shadow>, "~> 1.1"
|
56
|
+
s.add_dependency %q<code>, ">= 0.9.2", "< 2.0"
|
57
57
|
s.add_dependency %q<ori>, "~> 0.1.0"
|
58
|
-
s.add_dependency %q<methodfinder>, "~> 2.
|
59
|
-
s.add_dependency %q<method_locator>,"~> 0.0", ">= 0.0.4"
|
58
|
+
s.add_dependency %q<methodfinder>, "~> 2.2"
|
60
59
|
s.add_dependency %q<ruby_version>, "~> 1.0"
|
61
60
|
s.add_dependency %q<ruby_engine>, "~> 1.0"
|
62
61
|
s.add_dependency %q<ruby_info>, "~> 1.0"
|
63
62
|
s.add_dependency %q<os>
|
64
|
-
s.add_dependency %q<instance>, "~> 0.2"
|
65
63
|
end
|
data/lib/irbtools/libraries.rb
CHANGED
@@ -28,22 +28,27 @@ unless Irbtools.ripl?
|
|
28
28
|
end
|
29
29
|
|
30
30
|
Irbtools.add_library 'debugging/q', thread: :paint
|
31
|
-
|
32
31
|
Irbtools.add_library 'debugging/mof', thread: :paint
|
33
|
-
|
34
32
|
Irbtools.add_library 'debugging/re', thread: :paint
|
35
|
-
|
36
33
|
Irbtools.add_library 'debugging/beep', thread: :paint
|
37
|
-
|
38
34
|
Irbtools.add_library 'debugging/howtocall', thread: :paint
|
39
35
|
|
40
36
|
require_relative 'hirb'
|
41
37
|
|
42
|
-
|
43
|
-
|
38
|
+
Irbtools.add_library 'object_shadow', thread: :paint do
|
39
|
+
ObjectShadow.include(ObjectShadow::DeepInspect)
|
44
40
|
end
|
45
41
|
|
46
|
-
Irbtools.add_library 'ori', thread:
|
42
|
+
Irbtools.add_library 'ori', thread: :ori do
|
43
|
+
# TODO Readline history can be empty (issue)
|
44
|
+
module ORI::Internals
|
45
|
+
def self.get_ri_arg_prefix(cmd)
|
46
|
+
if cmd && (mat = cmd.match /\A(\s*.+?\.ri)\s+\S/)
|
47
|
+
mat[1]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
47
52
|
class Object
|
48
53
|
# patch ori to also allow shell-like "Array#slice" syntax
|
49
54
|
def ri(*args)
|
@@ -63,12 +68,6 @@ Irbtools.add_library 'ori', thread: 50 do
|
|
63
68
|
end
|
64
69
|
end
|
65
70
|
|
66
|
-
Irbtools.add_library 'method_locator', thread: 60 do
|
67
|
-
module MethodLocator
|
68
|
-
alias mlp method_lookup_path
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
71
|
Irbtools.add_library 'ruby_info', thread: :ri
|
73
72
|
Irbtools.add_library 'os', thread: :os
|
74
73
|
Irbtools.add_library 'ruby_engine', thread: :re
|
data/lib/irbtools/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irbtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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: 2019-04-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: irb
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.2'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '3.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
17
|
+
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :
|
19
|
+
version: 0.9.6
|
20
|
+
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - "
|
24
|
+
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
26
|
+
version: 0.9.6
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: every_day_irb
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,14 +126,14 @@ dependencies:
|
|
140
126
|
requirements:
|
141
127
|
- - "~>"
|
142
128
|
- !ruby/object:Gem::Version
|
143
|
-
version: '1.
|
129
|
+
version: '1.3'
|
144
130
|
type: :runtime
|
145
131
|
prerelease: false
|
146
132
|
version_requirements: !ruby/object:Gem::Requirement
|
147
133
|
requirements:
|
148
134
|
- - "~>"
|
149
135
|
- !ruby/object:Gem::Version
|
150
|
-
version: '1.
|
136
|
+
version: '1.3'
|
151
137
|
- !ruby/object:Gem::Dependency
|
152
138
|
name: interactive_editor
|
153
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,67 +183,67 @@ dependencies:
|
|
197
183
|
- !ruby/object:Gem::Version
|
198
184
|
version: '1.1'
|
199
185
|
- !ruby/object:Gem::Dependency
|
200
|
-
name:
|
186
|
+
name: object_shadow
|
201
187
|
requirement: !ruby/object:Gem::Requirement
|
202
188
|
requirements:
|
203
189
|
- - "~>"
|
204
190
|
- !ruby/object:Gem::Version
|
205
|
-
version: '
|
191
|
+
version: '1.1'
|
206
192
|
type: :runtime
|
207
193
|
prerelease: false
|
208
194
|
version_requirements: !ruby/object:Gem::Requirement
|
209
195
|
requirements:
|
210
196
|
- - "~>"
|
211
197
|
- !ruby/object:Gem::Version
|
212
|
-
version: '
|
198
|
+
version: '1.1'
|
213
199
|
- !ruby/object:Gem::Dependency
|
214
|
-
name:
|
200
|
+
name: code
|
215
201
|
requirement: !ruby/object:Gem::Requirement
|
216
202
|
requirements:
|
217
|
-
- - "
|
203
|
+
- - ">="
|
218
204
|
- !ruby/object:Gem::Version
|
219
|
-
version: 0.
|
205
|
+
version: 0.9.2
|
206
|
+
- - "<"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '2.0'
|
220
209
|
type: :runtime
|
221
210
|
prerelease: false
|
222
211
|
version_requirements: !ruby/object:Gem::Requirement
|
223
212
|
requirements:
|
224
|
-
- - "
|
213
|
+
- - ">="
|
225
214
|
- !ruby/object:Gem::Version
|
226
|
-
version: 0.
|
215
|
+
version: 0.9.2
|
216
|
+
- - "<"
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '2.0'
|
227
219
|
- !ruby/object:Gem::Dependency
|
228
|
-
name:
|
220
|
+
name: ori
|
229
221
|
requirement: !ruby/object:Gem::Requirement
|
230
222
|
requirements:
|
231
223
|
- - "~>"
|
232
224
|
- !ruby/object:Gem::Version
|
233
|
-
version:
|
225
|
+
version: 0.1.0
|
234
226
|
type: :runtime
|
235
227
|
prerelease: false
|
236
228
|
version_requirements: !ruby/object:Gem::Requirement
|
237
229
|
requirements:
|
238
230
|
- - "~>"
|
239
231
|
- !ruby/object:Gem::Version
|
240
|
-
version:
|
232
|
+
version: 0.1.0
|
241
233
|
- !ruby/object:Gem::Dependency
|
242
|
-
name:
|
234
|
+
name: methodfinder
|
243
235
|
requirement: !ruby/object:Gem::Requirement
|
244
236
|
requirements:
|
245
237
|
- - "~>"
|
246
238
|
- !ruby/object:Gem::Version
|
247
|
-
version: '
|
248
|
-
- - ">="
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: 0.0.4
|
239
|
+
version: '2.2'
|
251
240
|
type: :runtime
|
252
241
|
prerelease: false
|
253
242
|
version_requirements: !ruby/object:Gem::Requirement
|
254
243
|
requirements:
|
255
244
|
- - "~>"
|
256
245
|
- !ruby/object:Gem::Version
|
257
|
-
version: '
|
258
|
-
- - ">="
|
259
|
-
- !ruby/object:Gem::Version
|
260
|
-
version: 0.0.4
|
246
|
+
version: '2.2'
|
261
247
|
- !ruby/object:Gem::Dependency
|
262
248
|
name: ruby_version
|
263
249
|
requirement: !ruby/object:Gem::Requirement
|
@@ -314,31 +300,17 @@ dependencies:
|
|
314
300
|
- - ">="
|
315
301
|
- !ruby/object:Gem::Version
|
316
302
|
version: '0'
|
317
|
-
|
318
|
-
name: instance
|
319
|
-
requirement: !ruby/object:Gem::Requirement
|
320
|
-
requirements:
|
321
|
-
- - "~>"
|
322
|
-
- !ruby/object:Gem::Version
|
323
|
-
version: '0.2'
|
324
|
-
type: :runtime
|
325
|
-
prerelease: false
|
326
|
-
version_requirements: !ruby/object:Gem::Requirement
|
327
|
-
requirements:
|
328
|
-
- - "~>"
|
329
|
-
- !ruby/object:Gem::Version
|
330
|
-
version: '0.2'
|
331
|
-
description: Irbtools make Ruby's IRB more productive.
|
303
|
+
description: Irbtools make working with Ruby's IRB console more productive.
|
332
304
|
email: mail@janlelis.de
|
333
305
|
executables: []
|
334
306
|
extensions: []
|
335
307
|
extra_rdoc_files:
|
336
308
|
- README.md
|
337
309
|
- CONFIGURE.md
|
338
|
-
- CHANGELOG.
|
310
|
+
- CHANGELOG.md
|
339
311
|
- MIT-LICENSE.txt
|
340
312
|
files:
|
341
|
-
- CHANGELOG.
|
313
|
+
- CHANGELOG.md
|
342
314
|
- CONFIGURE.md
|
343
315
|
- MIT-LICENSE.txt
|
344
316
|
- README.md
|