gh_inspector 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87ebad675ac89d32c464cb575b64fb0c7cd4a6a0
4
- data.tar.gz: 2f511263536426b39583daac41577cb49e35552f
3
+ metadata.gz: 6ba701be35f8a6f2feb2409c45e7d4b03f730030
4
+ data.tar.gz: 03a74824f9bfb19c36e879cfb3157a3ce2f53772
5
5
  SHA512:
6
- metadata.gz: 8ecfa65327a763e07dfc422fc8fa924b164e1bdd4fd7ef49cb22fdd8c345e9cf10c3557e76d9e11c9785cf188f950dec6cb3a74cc5e29daa79371e0b035ef91a
7
- data.tar.gz: 76ff3baaea94f8dbbf1dcd3e886e33ec7652abaec64b2699b8507b5cd521443d1e1bb51f20c19da5e0ef223b5e354af1583c7864385530b069c7a05657db0d72
6
+ metadata.gz: 6cd592c6f8ced0a170db22f7abbeeed4774bfca21440c5c346058b44279d8af93c2eae1787878a013c0156f2ad1a0035c24c368ac8fa6eba6523058fbece7fba
7
+ data.tar.gz: 33bc859fb731994d10e162f0a6a1ab0b2d35ef8ec0cfdaa51ef1d82b0a4f917911e580c423bff4aded1f953098a0980cca7acb9b251f88d47657e5c6430b1cfe
@@ -1,32 +1,23 @@
1
- Style/ClassVars:
1
+ # That looks wrong
2
+ Layout/AlignHash:
2
3
  Enabled: false
3
4
 
4
- Style/ClassCheck:
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
- Style/IndentHash:
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
- Style/FileName:
29
+ Lint/UnusedMethodArgument:
39
30
  Enabled: false
40
31
 
41
- # $? Exit
42
- Style/SpecialGlobalVars:
32
+ # https://stackoverflow.com/a/13059657/865175
33
+ Lint/UriEscapeUnescape:
43
34
  Enabled: false
44
35
 
45
- # the let(:key) { ... } should be allowed in tests
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
- # Both string notations are okay
57
- Style/StringLiterals:
58
- Enabled: false
64
+ # Configuration parameters: CountKeywordArgs.
65
+ Metrics/ParameterLists:
66
+ Max: 17
59
67
 
60
- # The %w might be confusing for new users
61
- Style/WordArray:
62
- MinSize: 19
68
+ Metrics/PerceivedComplexity:
69
+ Max: 18
63
70
 
64
- # Not a good thing
65
- Style/RedundantSelf:
71
+ Naming/FileName:
66
72
  Enabled: false
67
73
 
68
- # raise and fail are both okay
69
- Style/SignalException:
74
+ # and and or is okay
75
+ Style/AndOr:
70
76
  Enabled: false
71
77
 
72
- # Better too much 'return' than one missing
73
- Style/RedundantReturn:
78
+ # Cop supports --auto-correct.
79
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
80
+ Style/BracesAroundHashParameters:
74
81
  Enabled: false
75
82
 
76
- # Having if in the same line might not always be good
77
- Style/IfUnlessModifier:
78
- Enabled: false
83
+ Style/ClassCheck:
84
+ EnforcedStyle: kind_of?
79
85
 
80
- # That looks wrong
81
- Style/AlignHash:
86
+ Style/ClassVars:
82
87
  Enabled: false
83
88
 
84
- # and and or is okay
85
- Style/AndOr:
89
+ Style/Documentation:
86
90
  Enabled: false
87
91
 
88
- # Offense count: 20
89
- Metrics/AbcSize:
90
- Max: 60
92
+ Style/DoubleNegation:
93
+ Enabled: false
91
94
 
92
- # Configuration parameters: CountComments.
93
- Metrics/ClassLength:
94
- Max: 320
95
+ # Needed for $verbose
96
+ Style/GlobalVars:
97
+ Enabled: false
95
98
 
96
- Metrics/CyclomaticComplexity:
97
- Max: 17
99
+ Style/GuardClause:
100
+ Enabled: false
98
101
 
99
- # Configuration parameters: AllowURI, URISchemes.
100
- Metrics/LineLength:
101
- Max: 370
102
+ # Having if in the same line might not always be good
103
+ Style/IfUnlessModifier:
104
+ Enabled: false
102
105
 
103
- # Configuration parameters: CountKeywordArgs.
104
- Metrics/ParameterLists:
105
- Max: 17
106
+ Style/RaiseArgs:
107
+ EnforcedStyle: exploded
106
108
 
107
- Metrics/PerceivedComplexity:
108
- Max: 18
109
+ # Better too much 'return' than one missing
110
+ Style/RedundantReturn:
111
+ Enabled: false
109
112
 
110
- Style/DotPosition:
113
+ # Not a good thing
114
+ Style/RedundantSelf:
111
115
  Enabled: false
112
116
 
113
- Style/GuardClause:
117
+ # raise and fail are both okay
118
+ Style/SignalException:
114
119
  Enabled: false
115
120
 
116
- Style/Documentation:
121
+ # $? Exit
122
+ Style/SpecialGlobalVars:
117
123
  Enabled: false
118
124
 
119
- Style/ZeroLengthPredicate:
125
+ # Both string notations are okay
126
+ Style/StringLiterals:
120
127
  Enabled: false
121
128
 
122
- Lint/UnusedMethodArgument:
129
+ # The %w might be confusing for new users
130
+ Style/WordArray:
131
+ MinSize: 19
132
+
133
+ Style/ZeroLengthPredicate:
123
134
  Enabled: false
@@ -1,5 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.3
3
+ - 2.1
4
+ - 2.2
5
+ - 2.3
6
+ - 2.4
7
+ - 2.5
4
8
 
5
9
  before_install: gem install bundler -v 1.11.2
@@ -1,5 +1,9 @@
1
1
  ### Master
2
2
 
3
+ ### 1.1.2
4
+
5
+ * URL escape the query for GH issues - revolter
6
+
3
7
  ### 1.1.1
4
8
 
5
9
  * Allow either all typoes, or all no typoes in the delegate call - revolter
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 += URI.escape(query)
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=#{URI.escape(query)}&type=Issues&utf8=✓"
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
- :inspector_successfully_recieved_report,
99
- :inspector_recieved_empty_report
99
+ deprecated_delegate_methods = %i[
100
+ inspector_successfully_recieved_report
101
+ inspector_recieved_empty_report
100
102
  ]
101
- new_delegate_methods = [
102
- :inspector_successfully_received_report,
103
- :inspector_received_empty_report
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|
@@ -1,3 +1,3 @@
1
1
  module GhInspector
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  end
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.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-02 00:00:00.000000000 Z
12
+ date: 2018-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler