debugging 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/Gemfile +8 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +1 -52
- data/lib/debugging/all.rb +1 -1
- data/lib/debugging/version.rb +1 -1
- metadata +3 -4
- data/lib/debugging/mof.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afb045a3e3347c58b06cdea68c4d484654d8f2da4f85e0454198544ef62bf67c
|
4
|
+
data.tar.gz: 30fc47cbcc4bbb8163549035e9c0d78cc5f2dd9205befc45fafcf395b26f19bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc5110354a3622932dcd671a5b6ba9953dee9f03d1ab13f97ac268b1ad72b7345260dafcebf7fe5d8862392213d2a1d4004eb2f870c2679f92eef67a1059d2d6
|
7
|
+
data.tar.gz: d5fab61e1aea27ed784fec2ca4d6047e0217bfbd5d8ffd30ebd1b219ed68318180088b3777fcbd7c43a7d383848e2a9ccebe96263b08ed0cf7e7e2e077060697
|
data/ChangeLog.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## ChangeLog
|
2
2
|
|
3
|
+
### 2.1.0 / 2022-12-25
|
4
|
+
|
5
|
+
* Remove `debugging/mof`; use looksee, object shadow, or IRB's own ls for reliable lookup path inspection
|
6
|
+
* Fix that `debugging/all` also loads howtocall
|
7
|
+
|
3
8
|
### 2.0.0 / 2021-12-30
|
4
9
|
|
5
10
|
* Remove `debugging/repl`, since Ruby now has `binding.irb`
|
data/Gemfile
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -95,57 +95,6 @@ a = ->(filter: /\A.*\z/, string:){ string[filter] }
|
|
95
95
|
howtocall a #=> call(string:, filter:)
|
96
96
|
```
|
97
97
|
|
98
|
-
|
99
|
-
### mof(obj, depth = nil)
|
100
|
-
|
101
|
-
"Methods of": Prints out available methods, ordered by modules:
|
102
|
-
|
103
|
-
```ruby
|
104
|
-
mof [1,2,3]
|
105
|
-
```
|
106
|
-
|
107
|
-
```
|
108
|
-
###
|
109
|
-
Eigenclass
|
110
|
-
|
111
|
-
Array
|
112
|
-
inspect to_s to_a to_h to_ary frozen? == eql? hash [] []= at fet
|
113
|
-
ch first last concat << push pop shift unshift insert each each_i
|
114
|
-
ndex reverse_each length size empty? find_index index rindex join r
|
115
|
-
everse reverse! rotate rotate! sort sort! sort_by! collect collect!
|
116
|
-
map map! select select! keep_if values_at delete delete_at delete_i
|
117
|
-
f reject reject! zip transpose replace clear fill include? <=> sli
|
118
|
-
ce slice! assoc rassoc + * - & | uniq uniq! compact compact! fl
|
119
|
-
atten flatten! count shuffle! shuffle sample cycle permutation combi
|
120
|
-
nation repeated_permutation repeated_combination product take take_whil
|
121
|
-
e drop drop_while bsearch pack
|
122
|
-
|
123
|
-
Enumerable
|
124
|
-
to_a entries to_h sort sort_by grep count find detect find_index f
|
125
|
-
ind_all select reject collect map flat_map collect_concat inject red
|
126
|
-
uce partition group_by first all? any? one? none? min max minmax
|
127
|
-
min_by max_by minmax_by member? include? each_with_index reverse_each
|
128
|
-
each_entry each_slice each_cons each_with_object zip take take_while
|
129
|
-
drop drop_while cycle chunk slice_before lazy
|
130
|
-
|
131
|
-
Object
|
132
|
-
|
133
|
-
Debugging
|
134
|
-
|
135
|
-
Kernel
|
136
|
-
nil? === =~ !~ eql? hash <=> class singleton_class clone dup tain
|
137
|
-
t tainted? untaint untrust untrusted? trust freeze frozen? to_s ins
|
138
|
-
pect methods singleton_methods protected_methods private_methods public
|
139
|
-
_methods instance_variables instance_variable_get instance_variable_set
|
140
|
-
instance_variable_defined? remove_instance_variable instance_of? kind_of?
|
141
|
-
is_a? tap send public_send respond_to? extend display method publi
|
142
|
-
c_method singleton_method define_singleton_method object_id to_enum enu
|
143
|
-
m_for
|
144
|
-
|
145
|
-
BasicObject
|
146
|
-
== equal? ! != instance_eval instance_exec __send__ __id__
|
147
|
-
```
|
148
|
-
|
149
98
|
### q(*args)
|
150
99
|
|
151
100
|
Like `Kernel#p`, but with colors on one line:
|
@@ -164,5 +113,5 @@ re "mail@janlelis.de", /\b([A-Z0-9._%+-]+)@([A-Z0-9.-]+\.[A-Z]{2,10})\b/i, 0..2
|
|
164
113
|
|
165
114
|
## J-_-L
|
166
115
|
|
167
|
-
Copyright (c) 2010-
|
116
|
+
Copyright (c) 2010-2022 Jan Lelis. MIT License. Originated from the
|
168
117
|
[zucker](https://github.com/janlelis/sugar_refinery) gem.
|
data/lib/debugging/all.rb
CHANGED
data/lib/debugging/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debugging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.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:
|
11
|
+
date: 2022-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paint
|
@@ -82,7 +82,6 @@ files:
|
|
82
82
|
- lib/debugging/beep.rb
|
83
83
|
- lib/debugging/callstack.rb
|
84
84
|
- lib/debugging/howtocall.rb
|
85
|
-
- lib/debugging/mof.rb
|
86
85
|
- lib/debugging/q.rb
|
87
86
|
- lib/debugging/re.rb
|
88
87
|
- lib/debugging/version.rb
|
@@ -113,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
112
|
- !ruby/object:Gem::Version
|
114
113
|
version: '0'
|
115
114
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
115
|
+
rubygems_version: 3.4.1
|
117
116
|
signing_key:
|
118
117
|
specification_version: 4
|
119
118
|
summary: Print debugging helpers
|
data/lib/debugging/mof.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'debugging'
|
2
|
-
|
3
|
-
module Debugging
|
4
|
-
private
|
5
|
-
|
6
|
-
def mof(obj, depth = nil, grep = //)
|
7
|
-
grep = Regexp.new(grep)
|
8
|
-
puts Paint["###", :red, :bold]
|
9
|
-
|
10
|
-
if obj.is_a? Module
|
11
|
-
klass, method_function = obj, :singleton_methods
|
12
|
-
depth += 1 if depth
|
13
|
-
else
|
14
|
-
klass, method_function = obj.class, :public_instance_methods
|
15
|
-
|
16
|
-
eigen_methods = obj.singleton_methods.grep(grep)
|
17
|
-
if eigen_methods.empty?
|
18
|
-
puts Paint['Eigenclass', :yellow]
|
19
|
-
else
|
20
|
-
puts Paint['Eigenclass', :green, :underline], eigen_methods.map(&:to_s)*' '
|
21
|
-
end
|
22
|
-
puts
|
23
|
-
end
|
24
|
-
|
25
|
-
(depth || klass.ancestors.size).times{ |level|
|
26
|
-
if cur = klass.ancestors[level]
|
27
|
-
level_methods = cur.send(method_function, false).grep(grep)
|
28
|
-
colors = level_methods.empty? ? [:yellow] : [:green, :underline]
|
29
|
-
puts Paint["#{cur}", *colors], level_methods.map(&:to_s)*' '
|
30
|
-
puts unless level_methods.empty?
|
31
|
-
end
|
32
|
-
}
|
33
|
-
|
34
|
-
nil
|
35
|
-
end
|
36
|
-
end
|