dead_code_detector 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dead_code_detector/base_method_wrapper.rb +4 -0
- data/lib/dead_code_detector/class_method_wrapper.rb +1 -1
- data/lib/dead_code_detector/initializer.rb +5 -3
- data/lib/dead_code_detector/instance_method_wrapper.rb +1 -1
- data/lib/dead_code_detector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60644539c351c9c6fba75e96f9a0e0b1509d9d2fb5b392613f5ee396d01fc170
|
4
|
+
data.tar.gz: b56f91fc57521d3405db882b51b2051972132e8af36663e7eb468a75e0633c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b18b4fe4c42e4fd445faf30afd2a74110d819b3518f23f7d7ad3803ca6f72bd58edaf4d02abef4991d1f2a171b0a808e15a3edb4a7cd4ac3521e70e9ef8bc343
|
7
|
+
data.tar.gz: 8ddce2288950a82afe6674151918e2c130eb331c37f0b6e32485343b85686a36b1381f44e098f8e2611f7b008b8e925bc2c5dce3f16b64a6100777db77cb3fe0
|
data/Gemfile.lock
CHANGED
@@ -44,7 +44,7 @@ module DeadCodeDetector
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def default_methods
|
47
|
-
klass.methods.map(&:to_s).select do |method_name|
|
47
|
+
@default_methods ||= klass.methods.map(&:to_s).select do |method_name|
|
48
48
|
owned_method?(method_name) && target_directory?(method_name)
|
49
49
|
end
|
50
50
|
end
|
@@ -61,9 +61,11 @@ module DeadCodeDetector
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def cache_methods_for(klass)
|
64
|
-
DeadCodeDetector.
|
65
|
-
DeadCodeDetector::
|
66
|
-
|
64
|
+
class_wrapper = DeadCodeDetector::ClassMethodWrapper.new(klass).tap(&:refresh_cache)
|
65
|
+
instance_wrapper = DeadCodeDetector::InstanceMethodWrapper.new(klass).tap(&:refresh_cache)
|
66
|
+
if class_wrapper.number_of_tracked_methods + instance_wrapper.number_of_tracked_methods > 0
|
67
|
+
DeadCodeDetector.config.storage.add(tracked_classes_key, klass.name)
|
68
|
+
end
|
67
69
|
end
|
68
70
|
|
69
71
|
def tracked_classes_key
|
@@ -38,7 +38,7 @@ module DeadCodeDetector
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def default_methods
|
41
|
-
klass.instance_methods.map(&:to_s).select do |method_name|
|
41
|
+
@default_methods ||= klass.instance_methods.map(&:to_s).select do |method_name|
|
42
42
|
owned_method?(method_name) && target_directory?(method_name)
|
43
43
|
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dead_code_detector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle d'Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|