peeky 0.0.48 → 0.0.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peeky/class_info.rb +3 -3
- data/lib/peeky/method_info.rb +14 -2
- data/lib/peeky/predicates/attr_reader_predicate.rb +1 -1
- data/lib/peeky/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aff77966760d7a7c6d692018aa18baa50188c6a7f22f989c6d5dda3805803568
|
4
|
+
data.tar.gz: fcc3b1211915afe38b6fa0cfa803813ea40c54a87d03893c1d8b816ea1188244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b00507cf58f9723d285c0405b7e96016fe51aa52b15b4a7a0eb60e03ce02ccbb226f60d22b9d005607064c03affb4ec67acc4c961675e1afc22170f01f93d5
|
7
|
+
data.tar.gz: 86804ade54bca766936cdddab08b04ca6c22a1a05e1845efa056a7538b4d44018a6933ea494e4c09406c31ce7ac6c7764928f7c13fdb212a568b2dce25959e00
|
data/lib/peeky/class_info.rb
CHANGED
@@ -252,21 +252,21 @@ module Peeky
|
|
252
252
|
def ruby_class_methods
|
253
253
|
@ruby_class_methods ||= ruby_class_method_names.map { |method_name| instance.class.method(method_name) }
|
254
254
|
rescue StandardError => e
|
255
|
-
|
255
|
+
puts 'ruby_class_methods'
|
256
256
|
puts e
|
257
257
|
end
|
258
258
|
|
259
259
|
def ruby_private_methods
|
260
260
|
@ruby_private_methods ||= ruby_private_method_names.map { |method_name| instance.method(method_name) }
|
261
261
|
rescue StandardError => e
|
262
|
-
|
262
|
+
puts 'ruby_private_methods'
|
263
263
|
puts e
|
264
264
|
end
|
265
265
|
|
266
266
|
def ruby_instance_methods
|
267
267
|
@ruby_instance_methods ||= ruby_instance_method_names.map { |method_name| instance.method(method_name) }
|
268
268
|
rescue StandardError => e
|
269
|
-
|
269
|
+
puts 'ruby_instance_methods'
|
270
270
|
puts e
|
271
271
|
end
|
272
272
|
|
data/lib/peeky/method_info.rb
CHANGED
@@ -94,15 +94,22 @@ module Peeky
|
|
94
94
|
return if minimalist_method.end_with?('=')
|
95
95
|
return unless optional?
|
96
96
|
|
97
|
+
# TODO: maybe I can use this technique instead and just read the source code
|
98
|
+
# file, line = @focal_method.source_location
|
99
|
+
|
97
100
|
tracer.enable do
|
101
|
+
# puts grab_source
|
98
102
|
# TODO: minimalist method should be able to handle class methods
|
99
103
|
@target_instance.instance_eval(minimalist_method) if @implementation_type == :method
|
100
104
|
@target_instance.class.instance_eval(minimalist_method) if @implementation_type == :class_method
|
101
|
-
rescue StandardError => e
|
105
|
+
rescue StandardError, LoadError # => e
|
102
106
|
# just print the error for now, we are only attempting to capture the
|
103
107
|
# first call, any errors inside the call cannot be dealt with and should
|
104
108
|
# not be re-raised
|
105
|
-
|
109
|
+
# red full stop
|
110
|
+
print "\e[31m.\e[0m"
|
111
|
+
# puts minimalist_method
|
112
|
+
# puts e.message
|
106
113
|
end
|
107
114
|
end
|
108
115
|
|
@@ -159,5 +166,10 @@ module Peeky
|
|
159
166
|
def writable?
|
160
167
|
@implementation_type == :attr_writer
|
161
168
|
end
|
169
|
+
|
170
|
+
def grab_source(limit = 10)
|
171
|
+
file, line = @focal_method.source_location
|
172
|
+
File.read(file).lines[line - 1, limit] if file && line
|
173
|
+
end
|
162
174
|
end
|
163
175
|
end
|
data/lib/peeky/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peeky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.2.
|
102
|
+
rubygems_version: 3.2.33
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Take a peek into your ruby classes and extract useful meta data
|