gh_inspector 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/gh_inspector/sidekick.rb +29 -4
- data/lib/gh_inspector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87ebad675ac89d32c464cb575b64fb0c7cd4a6a0
|
4
|
+
data.tar.gz: 2f511263536426b39583daac41577cb49e35552f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ecfa65327a763e07dfc422fc8fa924b164e1bdd4fd7ef49cb22fdd8c345e9cf10c3557e76d9e11c9785cf188f950dec6cb3a74cc5e29daa79371e0b035ef91a
|
7
|
+
data.tar.gz: 76ff3baaea94f8dbbf1dcd3e886e33ec7652abaec64b2699b8507b5cd521443d1e1bb51f20c19da5e0ef223b5e354af1583c7864385530b069c7a05657db0d72
|
data/CHANGELOG.md
CHANGED
@@ -7,12 +7,13 @@ module GhInspector
|
|
7
7
|
# then pass them back to the inspector who gets the public API credit.
|
8
8
|
|
9
9
|
class Sidekick
|
10
|
-
attr_accessor :repo_owner, :repo_name, :inspector
|
10
|
+
attr_accessor :repo_owner, :repo_name, :inspector, :using_deprecated_method
|
11
11
|
|
12
12
|
def initialize(inspector, repo_owner, repo_name)
|
13
13
|
self.inspector = inspector
|
14
14
|
self.repo_owner = repo_owner
|
15
15
|
self.repo_name = repo_name
|
16
|
+
self.using_deprecated_method = false
|
16
17
|
end
|
17
18
|
|
18
19
|
# Searches for a query, with a UI delegate
|
@@ -34,9 +35,17 @@ module GhInspector
|
|
34
35
|
# TODO: progress callback
|
35
36
|
|
36
37
|
if report.issues.any?
|
37
|
-
|
38
|
+
if self.using_deprecated_method
|
39
|
+
delegate.inspector_successfully_recieved_report(report, inspector)
|
40
|
+
else
|
41
|
+
delegate.inspector_successfully_received_report(report, inspector)
|
42
|
+
end
|
38
43
|
else
|
39
|
-
|
44
|
+
if self.using_deprecated_method
|
45
|
+
delegate.inspector_recieved_empty_report(report, inspector)
|
46
|
+
else
|
47
|
+
delegate.inspector_received_empty_report(report, inspector)
|
48
|
+
end
|
40
49
|
end
|
41
50
|
|
42
51
|
report
|
@@ -85,10 +94,26 @@ module GhInspector
|
|
85
94
|
end
|
86
95
|
|
87
96
|
def validate_delegate(delegate)
|
97
|
+
deprecated_delegate_methods = [
|
98
|
+
:inspector_successfully_recieved_report,
|
99
|
+
:inspector_recieved_empty_report
|
100
|
+
]
|
101
|
+
new_delegate_methods = [
|
102
|
+
:inspector_successfully_received_report,
|
103
|
+
:inspector_received_empty_report
|
104
|
+
]
|
105
|
+
|
106
|
+
deprecated_delegate_methods.each do |deprecated_delegate_method|
|
107
|
+
self.using_deprecated_method = true if delegate.methods.include?(deprecated_delegate_method)
|
108
|
+
end
|
109
|
+
|
88
110
|
e = Evidence.new
|
89
111
|
protocol = e.public_methods false
|
90
112
|
protocol.each do |m|
|
91
|
-
|
113
|
+
is_deprecated_method = deprecated_delegate_methods.include?(m)
|
114
|
+
is_new_delegate_method = new_delegate_methods.include?(m)
|
115
|
+
|
116
|
+
raise "#{delegate} does not handle #{m}" unless delegate.methods.include?(m) || is_deprecated_method || is_new_delegate_method
|
92
117
|
end
|
93
118
|
end
|
94
119
|
end
|
data/lib/gh_inspector/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gh_inspector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-02-
|
12
|
+
date: 2018-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|