errbit_github_plugin 0.3.0 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 03e8b522abb3f21ad344c7fc8daa4f3488858567
4
- data.tar.gz: 14c8b3453aa7376a0addec27428516d261c8ad67
2
+ SHA256:
3
+ metadata.gz: 0c13c852fd44efa8b849a98b63e77ad0b3901b0a49475dfc33dd625ad64f86dc
4
+ data.tar.gz: 8c2561530b4e8d20c6950a9ccb1619a02c39785d75dbc4992babe4a9cc65b782
5
5
  SHA512:
6
- metadata.gz: cbb84ca9d1757a665200ce84e57f87d6be39f9ca3f949e90a66b5ad961e691195512da8401b83322e0bb901d8c5205ea0f8c634325bed4b9c7728e0af2cc1f51
7
- data.tar.gz: 82c69cfe8522e76c4eb4a0e53fa0b4b62af7763a0c2cccfa7fe39cfe0ec4fcd9032e0ec96eecd68a339ce4aacdb0812730905c1f72f991a0ec1943038778df42
6
+ metadata.gz: bbe99ca05acc31a22cb923091c11a56f6152474286d7680b5e25df5b5e118da1e756ad33116600eeb9d6683949a16bf610fb118d1f6121a3bb1993d90d7f8b33
7
+ data.tar.gz: 67edcde4c42008cea711954490aca671188c23849f5252340a49a428cb197269c80d7ee441479747216b33dac2c0e9517fee3713d8981a0aac7e1bbec69457a5
data/.rspec CHANGED
@@ -1,3 +1,4 @@
1
- --color
2
1
  --format documentation
2
+ --color
3
3
  --require spec_helper
4
+ --order random
data/.rubocop.yml ADDED
@@ -0,0 +1,369 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+ - rubocop-disable_syntax
6
+
7
+ AllCops:
8
+ TargetRubyVersion: 4.0
9
+ NewCops: enable
10
+
11
+ # We use standard as a linter and formatter instead Rubocop.
12
+ # Also, we are explicitly disable all rubocop rules what
13
+ # already enabled in standard. And standard-performance.
14
+
15
+ # Standard rules. Style:
16
+
17
+ # Enforced by standard. Disable.
18
+ Style/StringLiterals:
19
+ Enabled: false
20
+
21
+ # Enforced by standard. Disable.
22
+ Style/HashSyntax:
23
+ Enabled: false
24
+
25
+ # Enforced by standard. Disable.
26
+ Style/NestedParenthesizedCalls:
27
+ Enabled: false
28
+
29
+ # Enforced by standard. Disable.
30
+ Style/RedundantRegexpArgument:
31
+ Enabled: false
32
+
33
+ # Enforced by standard. Disable.
34
+ Style/PercentLiteralDelimiters:
35
+ Enabled: false
36
+
37
+ # Enforced by standard. Disable.
38
+ Style/RedundantBegin:
39
+ Enabled: false
40
+
41
+ # Enforced by standard. Disable.
42
+ Style/SuperWithArgsParentheses:
43
+ Enabled: false
44
+
45
+ # Enforced by standard. Disable.
46
+ Style/Encoding:
47
+ Enabled: false
48
+
49
+ # Enforced by standard. Disable.
50
+ Style/NumericLiteralPrefix:
51
+ Enabled: false
52
+
53
+ # Enforced by standard. Disable.
54
+ Style/RedundantParentheses:
55
+ Enabled: false
56
+
57
+ # Enforced by standard. Disable.
58
+ Style/EmptyMethod:
59
+ Enabled: false
60
+
61
+ # Enforced by standard. Disable.
62
+ Style/SingleLineMethods:
63
+ Enabled: false
64
+
65
+ # Enforced by standard. Disable.
66
+ Style/SafeNavigation:
67
+ Enabled: false
68
+
69
+ # Enforced by standard. Disable.
70
+ Style/RescueStandardError:
71
+ Enabled: false
72
+
73
+ # Enforced by standard. Disable.
74
+ Style/RedundantSelf:
75
+ Enabled: false
76
+
77
+ # Enforced by standard. Disable.
78
+ Style/TernaryParentheses:
79
+ Enabled: false
80
+
81
+ # Enforced by standard. Disable.
82
+ Style/RedundantLineContinuation:
83
+ Enabled: false
84
+
85
+ # Enforced by standard. Disable.
86
+ Style/SlicingWithRange:
87
+ Enabled: false
88
+
89
+ # Enforced by standard. Disable.
90
+ Style/MultilineIfModifier:
91
+ Enabled: false
92
+
93
+ # Enforced by standard. Disable.
94
+ Style/RedundantCondition:
95
+ Enabled: false
96
+
97
+ # Enforced by standard. Disable.
98
+ Style/RedundantInterpolation:
99
+ Enabled: false
100
+
101
+ # Enforced by standard. Disable.
102
+ Style/OrAssignment:
103
+ Enabled: false
104
+
105
+ # Enforced by standard. Disable.
106
+ Style/ConditionalAssignment:
107
+ Enabled: false
108
+
109
+ # Enforced by standard. Disable.
110
+ Style/ItAssignment:
111
+ Enabled: false
112
+
113
+ # Enforced by standard. Disable.
114
+ Style/EachWithObject:
115
+ Enabled: false
116
+
117
+ # Enforced by standard. Disable.
118
+ Style/GlobalStdStream:
119
+ Enabled: false
120
+
121
+ # Enforced by standard. Disable.
122
+ Style/StringLiteralsInInterpolation:
123
+ Enabled: false
124
+
125
+ # Disabled as in standard.
126
+ Style/HashAsLastArrayItem:
127
+ Enabled: false
128
+
129
+ # Enforced by standard. Disable.
130
+ Style/Alias:
131
+ Enabled: false
132
+
133
+ # Standard rules. Layout:
134
+
135
+ # Enforced by standard. Disable.
136
+ Layout/HashAlignment:
137
+ Enabled: false
138
+
139
+ # Enforced by standard. Disable.
140
+ Layout/FirstArrayElementIndentation:
141
+ Enabled: false
142
+
143
+ # Enforced by standard. Disable.
144
+ Layout/SpaceInsideHashLiteralBraces:
145
+ Enabled: false
146
+
147
+ # Enforced by standard. Disable.
148
+ Layout/SpaceInsideStringInterpolation:
149
+ Enabled: false
150
+
151
+ # Enforced by standard. Disable.
152
+ Layout/DotPosition:
153
+ Enabled: false
154
+
155
+ # Enforced by standard. Disable.
156
+ Layout/ExtraSpacing:
157
+ Enabled: false
158
+
159
+ # Enforced by standard. Disable.
160
+ Layout/ArgumentAlignment:
161
+ Enabled: false
162
+
163
+ # Enforced by standard. Disable.
164
+ Layout/MultilineMethodCallBraceLayout:
165
+ Enabled: false
166
+
167
+ # Enforced by standard. Disable.
168
+ Layout/AccessModifierIndentation:
169
+ Enabled: false
170
+
171
+ # Enforced by standard. Disable.
172
+ Layout/FirstHashElementIndentation:
173
+ Enabled: false
174
+
175
+ # Enforced by standard. Disable.
176
+ Layout/IndentationWidth:
177
+ Enabled: false
178
+
179
+ # Enforced by standard. Disable.
180
+ Layout/ElseAlignment:
181
+ Enabled: false
182
+
183
+ # Enforced by standard. Disable.
184
+ Layout/EndAlignment:
185
+ Enabled: false
186
+
187
+ # Enforced by standard. Disable.
188
+ Layout/MultilineHashBraceLayout:
189
+ Enabled: false
190
+
191
+ # Enforced by standard. Disable.
192
+ Layout/EmptyLineBetweenDefs:
193
+ Enabled: false
194
+
195
+ # Enforced by standard. Disable.
196
+ Layout/MultilineArrayBraceLayout:
197
+ Enabled: false
198
+
199
+ # Enforced by standard. Disable.
200
+ Layout/EmptyLineAfterMagicComment:
201
+ Enabled: false
202
+
203
+ # Enforced by standard. Disable.
204
+ Layout/SpaceAroundOperators:
205
+ Enabled: false
206
+
207
+ # Enforced by standard. Disable.
208
+ Layout/ArrayAlignment:
209
+ Enabled: false
210
+
211
+ # Enforced by standard. Disable.
212
+ Layout/AssignmentIndentation:
213
+ Enabled: false
214
+
215
+ # Enforced by standard. Disable.
216
+ Layout/ClosingParenthesisIndentation:
217
+ Enabled: false
218
+
219
+ # Enforced by standard. Disable.
220
+ Layout/LineLength:
221
+ Enabled: false
222
+
223
+ # Enforced by standard. Disable.
224
+ Layout/MultilineMethodCallIndentation:
225
+ Enabled: false
226
+
227
+ # Enforced by standard. Disable.
228
+ Layout/CaseIndentation:
229
+ Enabled: false
230
+
231
+ # Standard rules. Lint:
232
+
233
+ # Enforced by standard. Disable.
234
+ Lint/ImplicitStringConcatenation:
235
+ Enabled: false
236
+
237
+ # Enforced by standard. Disable.
238
+ Lint/TripleQuotes:
239
+ Enabled: false
240
+
241
+ # Enforced by standard. Disable.
242
+ Lint/IneffectiveAccessModifier:
243
+ Enabled: false
244
+
245
+ # Enforced by standard. Disable.
246
+ Lint/SymbolConversion:
247
+ Enabled: false
248
+
249
+ # Enforced by rubocop and standard
250
+ Lint/CopDirectiveSyntax:
251
+ Enabled: true
252
+
253
+ # Enforced by standard. Disable.
254
+ Lint/DuplicateMethods:
255
+ Enabled: false
256
+
257
+ # Enforced by standard. Disable.
258
+ Lint/ConstantDefinitionInBlock:
259
+ Enabled: false
260
+
261
+ # Enforced by standard. Disable.
262
+ Lint/UselessTimes:
263
+ Enabled: false
264
+
265
+ # Standard-performance rules.
266
+
267
+ # Enforced by standard-performance. Disable.
268
+ Performance/Detect:
269
+ Enabled: false
270
+
271
+ # Enforced by standard-performance. Disable.
272
+ Performance/StringIdentifierArgument:
273
+ Enabled: false
274
+
275
+ # Enforced by standard-performance. Disable.
276
+ Performance/RegexpMatch:
277
+ Enabled: false
278
+
279
+ # Always enable rubocop Security:
280
+
281
+ # Enforced by rubocop and standard
282
+ Security/JSONLoad:
283
+ Enabled: true
284
+
285
+ # Our rubocop rules
286
+
287
+ # Bundler rules.
288
+
289
+ Bundler/OrderedGems:
290
+ Enabled: false
291
+
292
+ # Gemspec rules
293
+
294
+ Gemspec/OrderedDependencies:
295
+ Enabled: false
296
+
297
+ # Style rules
298
+
299
+ # Don't allow %i[foo bar baz]
300
+ Style/SymbolArray:
301
+ Enabled: true
302
+ EnforcedStyle: brackets
303
+
304
+ # Don't allow %w[foo bar baz]
305
+ Style/WordArray:
306
+ Enabled: true
307
+ EnforcedStyle: brackets
308
+
309
+ # Disable warnings like "Missing top-level documentation comment for"
310
+ Style/Documentation:
311
+ Enabled: false
312
+
313
+ # Disable as in standard.
314
+ Style/ArgumentsForwarding:
315
+ Enabled: false
316
+
317
+ # RSpec rules
318
+
319
+ # Prefer eq over be.
320
+ RSpec/BeEq:
321
+ Enabled: false
322
+
323
+ # Prefer eq over eql.
324
+ RSpec/BeEql:
325
+ Enabled: false
326
+
327
+ # We prefer to use `expect` over `allow`.
328
+ RSpec/StubbedMock:
329
+ Enabled: false
330
+
331
+ # We prefer multiple before blocks in tests.
332
+ RSpec/ScatteredSetup:
333
+ Enabled: false
334
+
335
+ # We use `expect` in before hooks.
336
+ RSpec/ExpectInHook:
337
+ Enabled: false
338
+
339
+ # We use item_1, item_2, etc. Disable.
340
+ RSpec/IndexedLet:
341
+ Enabled: false
342
+
343
+ # We don't use named subject's
344
+ RSpec/NamedSubject:
345
+ Enabled: false
346
+
347
+ # We prefer `receive` over `have_received`
348
+ RSpec/MessageSpies:
349
+ Enabled: false
350
+
351
+ # Naming rules:
352
+
353
+ # Disable anonymous block forwarding.
354
+ Naming/BlockForwarding:
355
+ Enabled: true
356
+ EnforcedStyle: explicit
357
+
358
+ # Enable and exclude specific files.
359
+ Naming/FileName:
360
+ Enabled: true
361
+
362
+ # Disabled syntax:
363
+
364
+ # Disable shorthand hash syntax like: ({ x:, y: })
365
+ # Disable % style literals
366
+ Style/DisableSyntax:
367
+ DisableSyntax:
368
+ - shorthand_hash_syntax
369
+ - percent_literals
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 4.0.5
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ ruby_version: 4.0
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Errbit Github Plugin [![TravisCI][travis-img-url]][travis-ci-url]
1
+ # Errbit GitHub Plugin
2
2
 
3
- [travis-img-url]: https://travis-ci.org/errbit/errbit_github_plugin.svg?branch=master
4
- [travis-ci-url]: http://travis-ci.org/errbit/errbit_github_plugin
3
+ [![RSpec](https://github.com/errbit/errbit_github_plugin/actions/workflows/rspec.yml/badge.svg)](https://github.com/errbit/errbit_github_plugin/actions/workflows/rspec.yml)
4
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
5
5
 
6
- This plugin provides GitHub issue tracker integration for Errbit and it is the
6
+ This plugin provides GitHub issue tracker integration for Errbit, and it is the
7
7
  only plugin included by default in Errbit.
data/Rakefile CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ErrbitGithubPlugin
2
4
  class AuthenticationError < Exception; end
3
5
  end
@@ -1,15 +1,17 @@
1
- require 'octokit'
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/core_ext/object/blank"
4
+ require "octokit"
2
5
 
3
6
  module ErrbitGithubPlugin
4
7
  class IssueTracker < ErrbitPlugin::IssueTracker
8
+ LABEL = "github"
5
9
 
6
- LABEL = 'github'
7
-
8
- NOTE = 'Please configure your github repository in the <strong>GITHUB ' <<
9
- 'REPO</strong> field above.<br/> Instead of providing your ' <<
10
- 'username & password, you can link your Github account to your ' <<
11
- 'user profile, and allow Errbit to create issues using your ' <<
12
- 'OAuth token.'
10
+ NOTE = "Please configure your GitHub repository in the <strong>GITHUB " \
11
+ "REPO</strong> field above.<br> Instead of providing your " \
12
+ "username & password, you can link your GitHub account to your " \
13
+ "user profile, and allow Errbit to create issues using your " \
14
+ "OAuth token."
13
15
 
14
16
  FIELDS = {
15
17
  username: {
@@ -35,13 +37,13 @@ module ErrbitGithubPlugin
35
37
  def self.icons
36
38
  @icons ||= {
37
39
  create: [
38
- 'image/png', ErrbitGithubPlugin.read_static_file('github_create.png')
40
+ "image/png", ErrbitGithubPlugin.read_static_file("github_create.png")
39
41
  ],
40
42
  goto: [
41
- 'image/png', ErrbitGithubPlugin.read_static_file('github_goto.png'),
43
+ "image/png", ErrbitGithubPlugin.read_static_file("github_goto.png")
42
44
  ],
43
45
  inactive: [
44
- 'image/png', ErrbitGithubPlugin.read_static_file('github_inactive.png'),
46
+ "image/png", ErrbitGithubPlugin.read_static_file("github_inactive.png")
45
47
  ]
46
48
  }
47
49
  end
@@ -56,12 +58,15 @@ module ErrbitGithubPlugin
56
58
 
57
59
  def errors
58
60
  errors = []
59
- if self.class.fields.detect {|f| options[f[0]].blank? }
60
- errors << [:base, 'You must specify your GitHub username and password']
61
+
62
+ if self.class.fields.detect { |f| options[f[0]].blank? }
63
+ errors << [:base, "You must specify your GitHub username and password"]
61
64
  end
65
+
62
66
  if repo.blank?
63
- errors << [:base, 'You must specify your GitHub repository url.']
67
+ errors << [:base, "You must specify your GitHub repository url."]
64
68
  end
69
+
65
70
  errors
66
71
  end
67
72
 
@@ -70,12 +75,14 @@ module ErrbitGithubPlugin
70
75
  end
71
76
 
72
77
  def create_issue(title, body, user: {})
73
- if user['github_login'] && user['github_oauth_token']
74
- github_client = Octokit::Client.new(
75
- login: user['github_login'], access_token: user['github_oauth_token'])
78
+ github_client = if user["github_login"] && user["github_oauth_token"]
79
+ Octokit::Client.new(
80
+ login: user["github_login"], access_token: user["github_oauth_token"]
81
+ )
76
82
  else
77
- github_client = Octokit::Client.new(
78
- login: options['username'], password: options['password'])
83
+ Octokit::Client.new(
84
+ login: options["username"], password: options["password"]
85
+ )
79
86
  end
80
87
  issue = github_client.create_issue(repo, title, body)
81
88
  issue.html_url
@@ -83,13 +90,18 @@ module ErrbitGithubPlugin
83
90
  raise ErrbitGithubPlugin::AuthenticationError, "Could not authenticate with GitHub. Please check your username and password."
84
91
  end
85
92
 
93
+ # @param url [String]
94
+ # @param user [Hash]
95
+ # @return [String] The URL of the closed issue
86
96
  def close_issue(url, user: {})
87
- if user['github_login'] && user['github_oauth_token']
88
- github_client = Octokit::Client.new(
89
- login: user['github_login'], access_token: user['github_oauth_token'])
97
+ github_client = if user["github_login"] && user["github_oauth_token"]
98
+ Octokit::Client.new(
99
+ login: user["github_login"], access_token: user["github_oauth_token"]
100
+ )
90
101
  else
91
- github_client = Octokit::Client.new(
92
- login: options['username'], password: options['password'])
102
+ Octokit::Client.new(
103
+ login: options["username"], password: options["password"]
104
+ )
93
105
  end
94
106
  # It would be better to get the number from issue.number when we create the issue,
95
107
  # however, since we only have the url, get the number from it.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ErrbitGithubPlugin
2
- VERSION = '0.3.0'
4
+ VERSION = "0.5.0"
3
5
  end
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "errbit_github_plugin/version"
2
- require 'errbit_github_plugin/error'
3
- require 'errbit_github_plugin/issue_tracker'
4
+ require "errbit_github_plugin/authentication_error"
5
+ require "errbit_github_plugin/issue_tracker"
4
6
 
5
7
  module ErrbitGithubPlugin
6
8
  def self.root
7
- File.expand_path '../..', __FILE__
9
+ File.expand_path "../..", __FILE__
8
10
  end
9
11
 
10
12
  def self.read_static_file(file)
11
- File.read(File.join(self.root, 'static', file))
13
+ File.read(File.join(root, "static", file))
12
14
  end
13
15
  end
14
16
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errbit_github_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Crosby
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2016-03-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: errbit_plugin
@@ -25,7 +24,7 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: octokit
27
+ name: faraday-retry
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
@@ -39,83 +38,13 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: guard
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: guard-rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: coveralls
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: bundler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rake
41
+ name: octokit
113
42
  requirement: !ruby/object:Gem::Requirement
114
43
  requirements:
115
44
  - - ">="
116
45
  - !ruby/object:Gem::Version
117
46
  version: '0'
118
- type: :development
47
+ type: :runtime
119
48
  prerelease: false
120
49
  version_requirements: !ruby/object:Gem::Requirement
121
50
  requirements:
@@ -129,7 +58,7 @@ dependencies:
129
58
  - - ">="
130
59
  - !ruby/object:Gem::Version
131
60
  version: '0'
132
- type: :development
61
+ type: :runtime
133
62
  prerelease: false
134
63
  version_requirements: !ruby/object:Gem::Requirement
135
64
  requirements:
@@ -143,30 +72,28 @@ executables: []
143
72
  extensions: []
144
73
  extra_rdoc_files: []
145
74
  files:
146
- - ".gitignore"
147
75
  - ".rspec"
148
- - ".travis.yml"
149
- - Gemfile
76
+ - ".rubocop.yml"
77
+ - ".ruby-version"
78
+ - ".standard.yml"
150
79
  - LICENSE.txt
151
80
  - README.md
152
81
  - Rakefile
153
- - errbit_github_plugin.gemspec
154
82
  - lib/errbit_github_plugin.rb
155
- - lib/errbit_github_plugin/error.rb
83
+ - lib/errbit_github_plugin/authentication_error.rb
156
84
  - lib/errbit_github_plugin/issue_tracker.rb
157
85
  - lib/errbit_github_plugin/version.rb
158
- - spec/issue_tracker_spec.rb
159
- - spec/spec_helper.rb
160
86
  - static/github_create.png
161
87
  - static/github_goto.png
162
88
  - static/github_inactive.png
163
- - vendor/assets/images/github_create.png
164
- - vendor/assets/images/github_inactive.png
165
89
  homepage: https://github.com/errbit/errbit_github_plugin
166
90
  licenses:
167
91
  - MIT
168
- metadata: {}
169
- post_install_message:
92
+ metadata:
93
+ homepage_uri: https://github.com/errbit/errbit_github_plugin
94
+ source_code_uri: https://github.com/errbit/errbit_github_plugin
95
+ bug_tracker_uri: https://github.com/errbit/errbit_github_plugin/issues
96
+ rubygems_mfa_required: 'true'
170
97
  rdoc_options: []
171
98
  require_paths:
172
99
  - lib
@@ -174,19 +101,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
101
  requirements:
175
102
  - - ">="
176
103
  - !ruby/object:Gem::Version
177
- version: '0'
104
+ version: 4.0.0
178
105
  required_rubygems_version: !ruby/object:Gem::Requirement
179
106
  requirements:
180
107
  - - ">="
181
108
  - !ruby/object:Gem::Version
182
109
  version: '0'
183
110
  requirements: []
184
- rubyforge_project:
185
- rubygems_version: 2.2.2
186
- signing_key:
111
+ rubygems_version: 4.0.13
187
112
  specification_version: 4
188
113
  summary: GitHub integration for Errbit
189
- test_files:
190
- - spec/issue_tracker_spec.rb
191
- - spec/spec_helper.rb
192
- has_rdoc:
114
+ test_files: []
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.swp
19
- .rspec
20
- vendor/bundle
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1
4
- - 2.2
5
- - 2.3.0
6
- sudo: false
7
- cache: bundler
8
- script:
9
- - bundle exec rspec
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
@@ -1,32 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'errbit_github_plugin/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'errbit_github_plugin'
8
- spec.version = ErrbitGithubPlugin::VERSION
9
- spec.authors = ['Stephen Crosby']
10
- spec.email = ['stevecrozz@gmail.com']
11
-
12
- spec.description = %q{GitHub integration for Errbit}
13
- spec.summary = %q{GitHub integration for Errbit}
14
- spec.homepage = 'https://github.com/errbit/errbit_github_plugin'
15
- spec.license = 'MIT'
16
-
17
- spec.files = `git ls-files`.split($/)
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ['lib']
21
-
22
- spec.add_dependency 'errbit_plugin'
23
- spec.add_dependency 'octokit'
24
-
25
- spec.add_development_dependency 'rspec'
26
- spec.add_development_dependency 'guard'
27
- spec.add_development_dependency 'guard-rspec'
28
- spec.add_development_dependency 'coveralls'
29
- spec.add_development_dependency 'bundler'
30
- spec.add_development_dependency 'rake'
31
- spec.add_development_dependency 'activesupport'
32
- end
@@ -1,156 +0,0 @@
1
- describe ErrbitGithubPlugin::IssueTracker do
2
- describe '.label' do
3
- it 'return LABEL' do
4
- expect(described_class.label).to eq described_class::LABEL
5
- end
6
- end
7
-
8
- describe '.note' do
9
- it 'return NOTE' do
10
- expect(described_class.note).to eq described_class::NOTE
11
- end
12
- end
13
-
14
- describe '.fields' do
15
- it 'return FIELDS' do
16
- expect(described_class.fields).to eq described_class::FIELDS
17
- end
18
- end
19
-
20
- describe '.icons' do
21
-
22
- it 'puts create icon onto the icons' do
23
- expect(described_class.icons[:create][0]).to eq 'image/png'
24
- expect(
25
- described_class.icons[:create][1]
26
- ).to eq ErrbitGithubPlugin.read_static_file('github_create.png')
27
- end
28
-
29
- it 'puts goto icon onto the icons' do
30
- expect(described_class.icons[:goto][0]).to eq 'image/png'
31
- expect(
32
- described_class.icons[:goto][1]
33
- ).to eq ErrbitGithubPlugin.read_static_file('github_goto.png')
34
- end
35
-
36
- it 'puts inactive icon onto the icons' do
37
- expect(described_class.icons[:inactive][0]).to eq 'image/png'
38
- expect(
39
- described_class.icons[:inactive][1]
40
- ).to eq ErrbitGithubPlugin.read_static_file('github_inactive.png')
41
- end
42
- end
43
-
44
- let(:tracker) { described_class.new(options) }
45
-
46
- describe '#configured?' do
47
- context 'with errors' do
48
- let(:options) { { invalid_key: '' } }
49
- it 'return false' do
50
- expect(tracker.configured?).to eq false
51
- end
52
- end
53
- context 'without errors' do
54
- let(:options) do
55
- { username: 'foo', password: 'bar', github_repo: 'user/repos' }
56
- end
57
- it 'return true' do
58
- expect(tracker.configured?).to eq true
59
- end
60
- end
61
- end
62
-
63
- describe '#url' do
64
- let(:options) { { github_repo: 'repo' } }
65
- it 'returns issues url' do
66
- expect(tracker.url).to eq 'https://github.com/repo/issues'
67
- end
68
- end
69
-
70
- describe '#errors' do
71
- subject { tracker.errors }
72
- context 'without username' do
73
- let(:options) { { username: '', password: 'bar', github_repo: 'repo' } }
74
- it { is_expected.not_to be_empty }
75
- end
76
- context 'without password' do
77
- let(:options) do
78
- { username: '', password: 'bar', github_repo: 'repo' }
79
- end
80
- it { is_expected.not_to be_empty }
81
- end
82
- context 'without github_repo' do
83
- let(:options) do
84
- { username: 'foo', password: 'bar', github_repo: '' }
85
- end
86
- it { is_expected.not_to be_empty }
87
- end
88
- context 'with completed options' do
89
- let(:options) do
90
- { username: 'foo', password: 'bar', github_repo: 'repo' }
91
- end
92
- it { is_expected.to be_empty }
93
- end
94
- end
95
-
96
- describe '#repo' do
97
- let(:options) { { github_repo: 'baz' } }
98
- it 'returns github repo' do
99
- expect(tracker.repo).to eq 'baz'
100
- end
101
- end
102
-
103
- describe '#create_issue' do
104
- subject { tracker.create_issue('title', 'body', user: user) }
105
- let(:options) do
106
- { username: 'foo', password: 'bar', github_repo: 'user/repos' }
107
- end
108
- let(:fake_github_client) do
109
- double('Fake GitHub Client').tap do |github_client|
110
- github_client.stub(:create_issue).and_return(fake_issue)
111
- end
112
- end
113
- let(:fake_issue) do
114
- double('Fake Issue').tap do |issue|
115
- issue.stub(:html_url).and_return('http://github.com/user/repos/issues/878')
116
- end
117
- end
118
-
119
- context 'signed in with token' do
120
- let(:user) do
121
- {
122
- 'github_login' => 'bob',
123
- 'github_oauth_token' => 'valid_token'
124
- }
125
- end
126
- it 'return issue url' do
127
- Octokit::Client.stub(:new).with(
128
- login: user['github_login'], access_token: user['github_oauth_token']
129
- ).and_return(fake_github_client)
130
- expect(subject).to eq fake_issue.html_url
131
- end
132
- end
133
-
134
- context 'signed in with password' do
135
- let(:user) { {} }
136
- it 'return issue url' do
137
- (Octokit::Client).stub(:new).with(
138
- login: options['username'], password: options['password']
139
- ).and_return(fake_github_client)
140
- expect(subject).to eq fake_issue.html_url
141
- end
142
- end
143
-
144
- context 'when unauthentication error' do
145
- let(:user) do
146
- { 'github_login' => 'alice', 'github_oauth_token' => 'invalid_token' }
147
- end
148
- it 'raise AuthenticationError' do
149
- (Octokit::Client).stub(:new).with(
150
- login: user['github_login'], access_token: user['github_oauth_token']
151
- ).and_raise(Octokit::Unauthorized)
152
- expect { subject }.to raise_error
153
- end
154
- end
155
- end
156
- end
data/spec/spec_helper.rb DELETED
@@ -1,28 +0,0 @@
1
- if ENV['COVERAGE']
2
- require 'simplecov'
3
- if ENV['CI']
4
- require 'coveralls'
5
- Coveralls.wear!
6
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
- SimpleCov::Formatter::HTMLFormatter,
8
- Coveralls::SimpleCov::Formatter
9
- ]
10
- end
11
-
12
- SimpleCov.start
13
- end
14
-
15
- require 'errbit_plugin'
16
- require 'errbit_github_plugin'
17
- require 'active_support/all'
18
-
19
- RSpec.configure do |config|
20
- config.run_all_when_everything_filtered = true
21
- config.filter_run :focus
22
-
23
- # Run specs in random order to surface order dependencies. If you find an
24
- # order dependency and want to debug it, you can fix the order by providing
25
- # the seed, which is printed after each run.
26
- # --seed 1234
27
- config.order = 'random'
28
- end
Binary file