gh_inspector 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +74 -63
- data/.travis.yml +5 -1
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/gh_inspector/sidekick.rb +10 -8
- 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: 6ba701be35f8a6f2feb2409c45e7d4b03f730030
|
|
4
|
+
data.tar.gz: 03a74824f9bfb19c36e879cfb3157a3ce2f53772
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cd592c6f8ced0a170db22f7abbeeed4774bfca21440c5c346058b44279d8af93c2eae1787878a013c0156f2ad1a0035c24c368ac8fa6eba6523058fbece7fba
|
|
7
|
+
data.tar.gz: 33bc859fb731994d10e162f0a6a1ab0b2d35ef8ec0cfdaa51ef1d82b0a4f917911e580c423bff4aded1f953098a0980cca7acb9b251f88d47657e5c6430b1cfe
|
data/.rubocop.yml
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# That looks wrong
|
|
2
|
+
Layout/AlignHash:
|
|
2
3
|
Enabled: false
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
EnforcedStyle: kind_of?
|
|
6
|
-
|
|
7
|
-
# Cop supports --auto-correct.
|
|
8
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
9
|
-
Style/BracesAroundHashParameters:
|
|
5
|
+
Layout/DotPosition:
|
|
10
6
|
Enabled: false
|
|
11
7
|
|
|
12
|
-
Lint/UselessAssignment:
|
|
13
|
-
Exclude:
|
|
14
|
-
- 'spec/**/*'
|
|
15
|
-
|
|
16
8
|
# Cop supports --auto-correct.
|
|
17
9
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
18
|
-
|
|
19
|
-
Enabled: false
|
|
20
|
-
|
|
21
|
-
Style/RaiseArgs:
|
|
22
|
-
EnforcedStyle: exploded
|
|
23
|
-
|
|
24
|
-
Style/DoubleNegation:
|
|
10
|
+
Layout/IndentHash:
|
|
25
11
|
Enabled: false
|
|
26
12
|
|
|
27
13
|
Lint/HandleExceptions:
|
|
28
14
|
Enabled: false
|
|
29
15
|
|
|
16
|
+
# the let(:key) { ... } should be allowed in tests
|
|
17
|
+
Lint/ParenthesesAsGroupedExpression:
|
|
18
|
+
Exclude:
|
|
19
|
+
- 'spec/**/*'
|
|
20
|
+
|
|
30
21
|
# Cop supports --auto-correct.
|
|
31
22
|
Lint/UnusedBlockArgument:
|
|
32
23
|
Enabled: false
|
|
@@ -35,89 +26,109 @@ Lint/UnusedBlockArgument:
|
|
|
35
26
|
Style/GlobalVars:
|
|
36
27
|
Enabled: false
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
Lint/UnusedMethodArgument:
|
|
39
30
|
Enabled: false
|
|
40
31
|
|
|
41
|
-
#
|
|
42
|
-
|
|
32
|
+
# https://stackoverflow.com/a/13059657/865175
|
|
33
|
+
Lint/UriEscapeUnescape:
|
|
43
34
|
Enabled: false
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
Lint/ParenthesesAsGroupedExpression:
|
|
36
|
+
Lint/UselessAssignment:
|
|
47
37
|
Exclude:
|
|
48
38
|
- 'spec/**/*'
|
|
49
39
|
|
|
40
|
+
# Offense count: 20
|
|
41
|
+
Metrics/AbcSize:
|
|
42
|
+
Max: 60
|
|
43
|
+
|
|
44
|
+
Metrics/BlockLength:
|
|
45
|
+
Enabled: false
|
|
46
|
+
|
|
47
|
+
# Configuration parameters: CountComments.
|
|
48
|
+
Metrics/ClassLength:
|
|
49
|
+
Max: 320
|
|
50
|
+
|
|
51
|
+
Metrics/CyclomaticComplexity:
|
|
52
|
+
Max: 17
|
|
53
|
+
|
|
54
|
+
# Configuration parameters: AllowURI, URISchemes.
|
|
55
|
+
Metrics/LineLength:
|
|
56
|
+
Max: 370
|
|
57
|
+
|
|
50
58
|
# options.rb might be large, we know that
|
|
51
59
|
Metrics/MethodLength:
|
|
52
60
|
Max: 60
|
|
53
61
|
Exclude:
|
|
54
62
|
- 'lib/*/options.rb'
|
|
55
63
|
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
# Configuration parameters: CountKeywordArgs.
|
|
65
|
+
Metrics/ParameterLists:
|
|
66
|
+
Max: 17
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
MinSize: 19
|
|
68
|
+
Metrics/PerceivedComplexity:
|
|
69
|
+
Max: 18
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
Style/RedundantSelf:
|
|
71
|
+
Naming/FileName:
|
|
66
72
|
Enabled: false
|
|
67
73
|
|
|
68
|
-
#
|
|
69
|
-
Style/
|
|
74
|
+
# and and or is okay
|
|
75
|
+
Style/AndOr:
|
|
70
76
|
Enabled: false
|
|
71
77
|
|
|
72
|
-
#
|
|
73
|
-
|
|
78
|
+
# Cop supports --auto-correct.
|
|
79
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
80
|
+
Style/BracesAroundHashParameters:
|
|
74
81
|
Enabled: false
|
|
75
82
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Enabled: false
|
|
83
|
+
Style/ClassCheck:
|
|
84
|
+
EnforcedStyle: kind_of?
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
Style/AlignHash:
|
|
86
|
+
Style/ClassVars:
|
|
82
87
|
Enabled: false
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
Style/AndOr:
|
|
89
|
+
Style/Documentation:
|
|
86
90
|
Enabled: false
|
|
87
91
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Max: 60
|
|
92
|
+
Style/DoubleNegation:
|
|
93
|
+
Enabled: false
|
|
91
94
|
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
# Needed for $verbose
|
|
96
|
+
Style/GlobalVars:
|
|
97
|
+
Enabled: false
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
Style/GuardClause:
|
|
100
|
+
Enabled: false
|
|
98
101
|
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
# Having if in the same line might not always be good
|
|
103
|
+
Style/IfUnlessModifier:
|
|
104
|
+
Enabled: false
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Max: 17
|
|
106
|
+
Style/RaiseArgs:
|
|
107
|
+
EnforcedStyle: exploded
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
# Better too much 'return' than one missing
|
|
110
|
+
Style/RedundantReturn:
|
|
111
|
+
Enabled: false
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
# Not a good thing
|
|
114
|
+
Style/RedundantSelf:
|
|
111
115
|
Enabled: false
|
|
112
116
|
|
|
113
|
-
|
|
117
|
+
# raise and fail are both okay
|
|
118
|
+
Style/SignalException:
|
|
114
119
|
Enabled: false
|
|
115
120
|
|
|
116
|
-
|
|
121
|
+
# $? Exit
|
|
122
|
+
Style/SpecialGlobalVars:
|
|
117
123
|
Enabled: false
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
# Both string notations are okay
|
|
126
|
+
Style/StringLiterals:
|
|
120
127
|
Enabled: false
|
|
121
128
|
|
|
122
|
-
|
|
129
|
+
# The %w might be confusing for new users
|
|
130
|
+
Style/WordArray:
|
|
131
|
+
MinSize: 19
|
|
132
|
+
|
|
133
|
+
Style/ZeroLengthPredicate:
|
|
123
134
|
Enabled: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -87,9 +87,9 @@ Protocol for custom objects:
|
|
|
87
87
|
|
|
88
88
|
## Development
|
|
89
89
|
|
|
90
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
90
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
91
91
|
|
|
92
|
-
The usage section of this README is generated from inline documentation inside the classes, to update it run `rake readme`.
|
|
92
|
+
The usage section of this README is generated from inline documentation inside the classes, to update it run `bundle exec rake readme`.
|
|
93
93
|
|
|
94
94
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
95
95
|
|
|
@@ -41,11 +41,13 @@ module GhInspector
|
|
|
41
41
|
delegate.inspector_successfully_received_report(report, inspector)
|
|
42
42
|
end
|
|
43
43
|
else
|
|
44
|
+
# rubocop:disable Style/IfInsideElse
|
|
44
45
|
if self.using_deprecated_method
|
|
45
46
|
delegate.inspector_recieved_empty_report(report, inspector)
|
|
46
47
|
else
|
|
47
48
|
delegate.inspector_received_empty_report(report, inspector)
|
|
48
49
|
end
|
|
50
|
+
# rubocop:enable Style/IfInsideElse
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
report
|
|
@@ -62,7 +64,7 @@ module GhInspector
|
|
|
62
64
|
# Generates a URL for the request
|
|
63
65
|
def url_for_request(query, sort_by: nil, order: nil)
|
|
64
66
|
url = "https://api.github.com/search/issues?q="
|
|
65
|
-
url +=
|
|
67
|
+
url += ERB::Util.url_encode(query)
|
|
66
68
|
url += "+repo:#{repo_owner}/#{repo_name}"
|
|
67
69
|
url += "&sort=#{sort_by}" if sort_by
|
|
68
70
|
url += "&order=#{order}" if order
|
|
@@ -86,7 +88,7 @@ module GhInspector
|
|
|
86
88
|
# Converts a GitHub search JSON into a InspectionReport
|
|
87
89
|
def parse_results(query, results)
|
|
88
90
|
report = InspectionReport.new
|
|
89
|
-
report.url = "https://github.com/#{repo_owner}/#{repo_name}/search?q=#{
|
|
91
|
+
report.url = "https://github.com/#{repo_owner}/#{repo_name}/search?q=#{ERB::Util.url_encode(query)}&type=Issues&utf8=✓"
|
|
90
92
|
report.query = query
|
|
91
93
|
report.total_results = results['total_count']
|
|
92
94
|
report.issues = results['items'].map { |item| Issue.new(item) }
|
|
@@ -94,13 +96,13 @@ module GhInspector
|
|
|
94
96
|
end
|
|
95
97
|
|
|
96
98
|
def validate_delegate(delegate)
|
|
97
|
-
deprecated_delegate_methods = [
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
deprecated_delegate_methods = %i[
|
|
100
|
+
inspector_successfully_recieved_report
|
|
101
|
+
inspector_recieved_empty_report
|
|
100
102
|
]
|
|
101
|
-
new_delegate_methods = [
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
new_delegate_methods = %i[
|
|
104
|
+
inspector_successfully_received_report
|
|
105
|
+
inspector_received_empty_report
|
|
104
106
|
]
|
|
105
107
|
|
|
106
108
|
deprecated_delegate_methods.each do |deprecated_delegate_method|
|
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.2
|
|
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-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|