errbit_plugin 0.6.0 → 0.8.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 +5 -5
- data/.rspec +4 -0
- data/.rubocop.yml +377 -0
- data/.ruby-version +1 -0
- data/.standard.yml +1 -0
- data/README.md +33 -28
- data/Rakefile +2 -0
- data/lib/errbit_plugin/issue_tracker.rb +2 -0
- data/lib/errbit_plugin/{validate_issue_tracker.rb → issue_tracker_validator.rb} +9 -7
- data/lib/errbit_plugin/none_issue_tracker.rb +57 -0
- data/lib/errbit_plugin/registry.rb +7 -4
- data/lib/errbit_plugin/version.rb +3 -1
- data/lib/errbit_plugin.rb +4 -2
- metadata +18 -55
- data/.coveralls.yml +0 -2
- data/.gitignore +0 -23
- data/.travis.yml +0 -15
- data/Gemfile +0 -9
- data/Guardfile +0 -8
- data/errbit_plugin.gemspec +0 -23
- data/lib/errbit_plugin/issue_trackers/none.rb +0 -31
- data/spec/errbit_plugin/registry_spec.rb +0 -66
- data/spec/errbit_plugin/validate_issue_tracker_spec.rb +0 -255
- data/spec/spec_helper.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c5d3bdf7d5dc59bf8a59721802488f859c956892cb1763f7d2958be6aa753a8f
|
|
4
|
+
data.tar.gz: 34bf05aba892110c124d2aea3d6e8807c36c21fe14037a7f1a61e6e48aa936aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5a36c6b08ae920dc2b13515ed1fa7d69ed44a3e1edbdb766954da0b728b3bd4f9ddb184fa078fe8d481ed31b66d138b62253ab6126b49864eafb6dd0c28500d
|
|
7
|
+
data.tar.gz: caa502d7596676de1641139734549b612f3b391e381bfcb9d7ca3638c0b2196c506ab68445625400162e6c3ea314558873bfb38564176b3aa4ab0ea93d15055f
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
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
|
+
# Ignore example length
|
|
348
|
+
RSpec/ExampleLength:
|
|
349
|
+
Enabled: false
|
|
350
|
+
|
|
351
|
+
# Ignore maximum example group nesting
|
|
352
|
+
RSpec/NestedGroups:
|
|
353
|
+
Enabled: false
|
|
354
|
+
|
|
355
|
+
# Ignore subject after let declarations
|
|
356
|
+
RSpec/LeadingSubject:
|
|
357
|
+
Enabled: false
|
|
358
|
+
|
|
359
|
+
# Naming rules:
|
|
360
|
+
|
|
361
|
+
# Disable anonymous block forwarding.
|
|
362
|
+
Naming/BlockForwarding:
|
|
363
|
+
Enabled: true
|
|
364
|
+
EnforcedStyle: explicit
|
|
365
|
+
|
|
366
|
+
# Enable and exclude specific files.
|
|
367
|
+
Naming/FileName:
|
|
368
|
+
Enabled: true
|
|
369
|
+
|
|
370
|
+
# Disabled syntax:
|
|
371
|
+
|
|
372
|
+
# Disable shorthand hash syntax like: ({ x:, y: })
|
|
373
|
+
# Disable % style literals
|
|
374
|
+
Style/DisableSyntax:
|
|
375
|
+
DisableSyntax:
|
|
376
|
+
- shorthand_hash_syntax
|
|
377
|
+
- 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,42 +1,49 @@
|
|
|
1
|
-
# ErrbitPlugin
|
|
1
|
+
# ErrbitPlugin
|
|
2
|
+
|
|
3
|
+
[](https://github.com/errbit/errbit_plugin/actions/workflows/rspec.yml)
|
|
4
|
+
[](https://github.com/standardrb/standard)
|
|
5
|
+
|
|
2
6
|
ErrbitPlugin provides a set of base classes that you can extend to create
|
|
3
7
|
Errbit plugins.
|
|
4
8
|
|
|
5
9
|
## Creating plugins
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
Errbit plugins are Ruby gems that extend the functionality of Errbit. To get
|
|
12
|
+
started, create a Ruby gem and add `errbit_plugin` as a dependency in your
|
|
8
13
|
gem's gemspec.
|
|
9
14
|
|
|
10
15
|
Now you can start adding plugins. At the moment, there is only one kind of
|
|
11
16
|
plugin you can create, and that is the issue tracker.
|
|
12
17
|
|
|
13
18
|
### Issue Trackers
|
|
19
|
+
|
|
14
20
|
An issue tracker plugin is a Ruby class that enables you to link errors within
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
create an issue on the external issue tracker out of the given
|
|
19
|
-
that issue to the
|
|
20
|
-
to close the issue on the external issue tracker, if your
|
|
21
|
-
method to do so.
|
|
21
|
+
Errbit to an issue in an external issue tracker like GitHub. An app within
|
|
22
|
+
Errbit can be associated with an issue tracker or not. When there is an
|
|
23
|
+
association, Errbit users can choose 'create issue' from an error page which
|
|
24
|
+
will both create an issue on the external issue tracker out of the given
|
|
25
|
+
error and link that issue to the Errbit error. Likewise, a user can also
|
|
26
|
+
choose 'close issue' to close the issue on the external issue tracker, if your
|
|
27
|
+
plugin provides a method to do so.
|
|
22
28
|
|
|
23
29
|
Your issue tracker plugin is responsible for providing the interface defined by
|
|
24
|
-
ErrbitPlugin::IssueTracker
|
|
25
|
-
the class must extend ErrbitPlugin::IssueTracker
|
|
30
|
+
`ErrbitPlugin::IssueTracker`. All the required methods must be implemented and
|
|
31
|
+
the class must extend `ErrbitPlugin::IssueTracker`. Here's an example:
|
|
32
|
+
|
|
26
33
|
```ruby
|
|
27
34
|
class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
28
35
|
|
|
29
|
-
# A unique label for your tracker plugin used internally by
|
|
36
|
+
# A unique label for your tracker plugin used internally by Errbit
|
|
30
37
|
def self.label
|
|
31
|
-
|
|
38
|
+
"my-tracker"
|
|
32
39
|
end
|
|
33
40
|
|
|
34
41
|
def self.note
|
|
35
|
-
|
|
42
|
+
"a note about this tracker that users will see"
|
|
36
43
|
end
|
|
37
44
|
|
|
38
45
|
# Form fields that will be presented to the administrator when setting up
|
|
39
|
-
# or editing the
|
|
46
|
+
# or editing the Errbit app. The values we collect will be available for use
|
|
40
47
|
# later when we have an instance of this class.
|
|
41
48
|
def self.fields
|
|
42
49
|
{
|
|
@@ -56,14 +63,14 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
|
56
63
|
# and the binary icon data.
|
|
57
64
|
def self.icons
|
|
58
65
|
@icons ||= {
|
|
59
|
-
create: [
|
|
60
|
-
goto: [
|
|
61
|
-
inactive: [
|
|
66
|
+
create: [ "image/png", File.read("./path/to/create.png") ],
|
|
67
|
+
goto: [ "image/png", File.read("./path/to/goto.png") ],
|
|
68
|
+
inactive: [ "image/png", File.read("./path/to/inactive.png") ],
|
|
62
69
|
}
|
|
63
70
|
end
|
|
64
71
|
|
|
65
72
|
# If this tracker can be in a configured or non-configured state, you can let
|
|
66
|
-
#
|
|
73
|
+
# Errbit know by returning a Boolean here
|
|
67
74
|
def configured?
|
|
68
75
|
# In this case, we'll say this issue tracker is configured when username
|
|
69
76
|
# and password are set
|
|
@@ -76,7 +83,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
|
76
83
|
if options[:username]
|
|
77
84
|
{}
|
|
78
85
|
else
|
|
79
|
-
{ field_one:
|
|
86
|
+
{ field_one: "username must be present" }
|
|
80
87
|
end
|
|
81
88
|
end
|
|
82
89
|
|
|
@@ -88,7 +95,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
|
88
95
|
def create_issue(title, body, user: {})
|
|
89
96
|
# Create an issue! Then update the problem to link it.
|
|
90
97
|
|
|
91
|
-
|
|
98
|
+
"https://sometracker.com/my/issue/123"
|
|
92
99
|
end
|
|
93
100
|
|
|
94
101
|
# This method is optional. Errbit will create body text for your issue by
|
|
@@ -100,10 +107,10 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
|
100
107
|
# If you don't implement this method, Errbit will render a body using a
|
|
101
108
|
# default template
|
|
102
109
|
#
|
|
103
|
-
# @see
|
|
110
|
+
# @see https://apidock.com/rails/ActionController/Base/render_to_string
|
|
104
111
|
def render_body_args
|
|
105
112
|
# In this example, we want to render a special file
|
|
106
|
-
[
|
|
113
|
+
["/path/to/some/template", formats: [:rdoc]]
|
|
107
114
|
end
|
|
108
115
|
|
|
109
116
|
# This method is optional, and is where you actually go close the issue on
|
|
@@ -117,14 +124,12 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker
|
|
|
117
124
|
|
|
118
125
|
# The URL for your remote issue tracker
|
|
119
126
|
def url
|
|
120
|
-
|
|
127
|
+
"https://some-remote-tracker.com"
|
|
121
128
|
end
|
|
122
129
|
end
|
|
123
130
|
```
|
|
124
131
|
|
|
125
|
-
|
|
126
|
-
|
|
127
132
|
## Contributing
|
|
128
133
|
|
|
129
134
|
Discuss any changes you'd like to make with the authors on the mailing list, or
|
|
130
|
-
by opening a
|
|
135
|
+
by opening a GitHub issue.
|
data/Rakefile
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module ErrbitPlugin
|
|
2
|
-
class
|
|
4
|
+
class IssueTrackerValidator
|
|
3
5
|
def initialize(klass)
|
|
4
6
|
@klass = klass
|
|
5
7
|
@errors = []
|
|
@@ -17,11 +19,11 @@ module ErrbitPlugin
|
|
|
17
19
|
private
|
|
18
20
|
|
|
19
21
|
def good_inherit?
|
|
20
|
-
|
|
22
|
+
if @klass.ancestors.include?(ErrbitPlugin::IssueTracker)
|
|
23
|
+
true
|
|
24
|
+
else
|
|
21
25
|
add_errors(:not_inherited)
|
|
22
26
|
false
|
|
23
|
-
else
|
|
24
|
-
true
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
|
@@ -35,7 +37,7 @@ module ErrbitPlugin
|
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
|
|
38
|
-
impl.all?
|
|
40
|
+
impl.all?(true)
|
|
39
41
|
end
|
|
40
42
|
|
|
41
43
|
def implements_class_methods?
|
|
@@ -48,14 +50,14 @@ module ErrbitPlugin
|
|
|
48
50
|
end
|
|
49
51
|
end
|
|
50
52
|
|
|
51
|
-
impl.all?
|
|
53
|
+
impl.all?(true)
|
|
52
54
|
end
|
|
53
55
|
|
|
54
56
|
def instance
|
|
55
57
|
@instance ||= @klass.new({})
|
|
56
58
|
end
|
|
57
59
|
|
|
58
|
-
def add_errors(key, value=nil)
|
|
60
|
+
def add_errors(key, value = nil)
|
|
59
61
|
@errors << [key, value].compact
|
|
60
62
|
end
|
|
61
63
|
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ErrbitPlugin
|
|
4
|
+
class NoneIssueTracker < IssueTracker
|
|
5
|
+
def self.label
|
|
6
|
+
"none"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.note
|
|
10
|
+
"When no issue tracker has been configured, you will be able to " \
|
|
11
|
+
"leave comments on errors."
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.fields
|
|
15
|
+
{}
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.icons
|
|
19
|
+
@icons ||= {
|
|
20
|
+
create: ["image/png", read_static_file("none_create.png")],
|
|
21
|
+
goto: ["image/png", read_static_file("none_create.png")],
|
|
22
|
+
inactive: ["image/png", read_static_file("none_inactive.png")]
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.read_static_file(file)
|
|
27
|
+
File.read(File.expand_path(File.join(
|
|
28
|
+
File.dirname(__FILE__), "..", "..", "static", file
|
|
29
|
+
)))
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
##
|
|
33
|
+
# The NoneIssueTracker is mark like configured? false because it not valid
|
|
34
|
+
# like a real IssueTracker
|
|
35
|
+
def configured?
|
|
36
|
+
false
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def errors
|
|
40
|
+
{}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def url
|
|
44
|
+
""
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def create_issue(*) # rubocop:disable Naming/PredicateMethod
|
|
48
|
+
false
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def close_issue(*) # rubocop:disable Naming/PredicateMethod
|
|
52
|
+
false
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
ErrbitPlugin::Registry.add_issue_tracker(ErrbitPlugin::NoneIssueTracker)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module ErrbitPlugin
|
|
2
4
|
class IncompatibilityError < StandardError; end
|
|
5
|
+
|
|
3
6
|
class AlreadyRegisteredError < StandardError; end
|
|
4
7
|
|
|
5
8
|
module Registry
|
|
@@ -8,17 +11,17 @@ module ErrbitPlugin
|
|
|
8
11
|
def self.add_issue_tracker(klass)
|
|
9
12
|
key = klass.label
|
|
10
13
|
|
|
11
|
-
if issue_trackers.
|
|
14
|
+
if issue_trackers.key?(key)
|
|
12
15
|
raise AlreadyRegisteredError,
|
|
13
16
|
"issue_tracker '#{key}' already registered"
|
|
14
17
|
end
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
validator = IssueTrackerValidator.new(klass)
|
|
17
20
|
|
|
18
|
-
if
|
|
21
|
+
if validator.valid?
|
|
19
22
|
@issue_trackers[key] = klass
|
|
20
23
|
else
|
|
21
|
-
raise IncompatibilityError.new(
|
|
24
|
+
raise IncompatibilityError.new(validator.errors.join("; "))
|
|
22
25
|
end
|
|
23
26
|
end
|
|
24
27
|
|
data/lib/errbit_plugin.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "errbit_plugin/version"
|
|
2
4
|
require "errbit_plugin/registry"
|
|
3
5
|
require "errbit_plugin/issue_tracker"
|
|
4
|
-
require "errbit_plugin/
|
|
5
|
-
require "errbit_plugin/
|
|
6
|
+
require "errbit_plugin/issue_tracker_validator"
|
|
7
|
+
require "errbit_plugin/none_issue_tracker"
|
metadata
CHANGED
|
@@ -1,43 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: errbit_plugin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Crosby
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.3'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.3'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
41
12
|
description: Base to create an errbit plugin
|
|
42
13
|
email:
|
|
43
14
|
- stevecrozz@gmail.com
|
|
@@ -45,34 +16,32 @@ executables: []
|
|
|
45
16
|
extensions: []
|
|
46
17
|
extra_rdoc_files: []
|
|
47
18
|
files:
|
|
48
|
-
- ".
|
|
49
|
-
- ".
|
|
50
|
-
- ".
|
|
51
|
-
-
|
|
52
|
-
- Guardfile
|
|
19
|
+
- ".rspec"
|
|
20
|
+
- ".rubocop.yml"
|
|
21
|
+
- ".ruby-version"
|
|
22
|
+
- ".standard.yml"
|
|
53
23
|
- LICENSE
|
|
54
24
|
- LICENSE.txt
|
|
55
25
|
- README.md
|
|
56
26
|
- Rakefile
|
|
57
|
-
- errbit_plugin.gemspec
|
|
58
27
|
- lib/errbit_plugin.rb
|
|
59
28
|
- lib/errbit_plugin/issue_tracker.rb
|
|
60
|
-
- lib/errbit_plugin/
|
|
29
|
+
- lib/errbit_plugin/issue_tracker_validator.rb
|
|
30
|
+
- lib/errbit_plugin/none_issue_tracker.rb
|
|
61
31
|
- lib/errbit_plugin/registry.rb
|
|
62
|
-
- lib/errbit_plugin/validate_issue_tracker.rb
|
|
63
32
|
- lib/errbit_plugin/version.rb
|
|
64
|
-
- spec/errbit_plugin/registry_spec.rb
|
|
65
|
-
- spec/errbit_plugin/validate_issue_tracker_spec.rb
|
|
66
|
-
- spec/spec_helper.rb
|
|
67
33
|
- static/fake_create.png
|
|
68
34
|
- static/fake_inactive.png
|
|
69
35
|
- static/none_create.png
|
|
70
36
|
- static/none_inactive.png
|
|
71
|
-
homepage:
|
|
37
|
+
homepage: https://github.com/errbit/errbit_plugin
|
|
72
38
|
licenses:
|
|
73
39
|
- MIT
|
|
74
|
-
metadata:
|
|
75
|
-
|
|
40
|
+
metadata:
|
|
41
|
+
homepage_uri: https://github.com/errbit/errbit_plugin
|
|
42
|
+
source_code_uri: https://github.com/errbit/errbit_plugin
|
|
43
|
+
bug_tracker_uri: https://github.com/errbit/errbit_plugin/issues
|
|
44
|
+
rubygems_mfa_required: 'true'
|
|
76
45
|
rdoc_options: []
|
|
77
46
|
require_paths:
|
|
78
47
|
- lib
|
|
@@ -80,20 +49,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
80
49
|
requirements:
|
|
81
50
|
- - ">="
|
|
82
51
|
- !ruby/object:Gem::Version
|
|
83
|
-
version:
|
|
52
|
+
version: 4.0.0
|
|
84
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
54
|
requirements:
|
|
86
55
|
- - ">="
|
|
87
56
|
- !ruby/object:Gem::Version
|
|
88
57
|
version: '0'
|
|
89
58
|
requirements: []
|
|
90
|
-
|
|
91
|
-
rubygems_version: 2.2.2
|
|
92
|
-
signing_key:
|
|
59
|
+
rubygems_version: 4.0.13
|
|
93
60
|
specification_version: 4
|
|
94
61
|
summary: Base to create an errbit plugin
|
|
95
|
-
test_files:
|
|
96
|
-
- spec/errbit_plugin/registry_spec.rb
|
|
97
|
-
- spec/errbit_plugin/validate_issue_tracker_spec.rb
|
|
98
|
-
- spec/spec_helper.rb
|
|
99
|
-
has_rdoc:
|
|
62
|
+
test_files: []
|
data/.coveralls.yml
DELETED
data/.gitignore
DELETED
|
@@ -1,23 +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
|
-
.ruby-version
|
|
19
|
-
|
|
20
|
-
# YARD artifacts
|
|
21
|
-
.yardoc
|
|
22
|
-
_yardoc
|
|
23
|
-
doc/
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Guardfile
DELETED
data/errbit_plugin.gemspec
DELETED
|
@@ -1,23 +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_plugin/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "errbit_plugin"
|
|
8
|
-
spec.version = ErrbitPlugin::VERSION
|
|
9
|
-
spec.authors = ["Stephen Crosby"]
|
|
10
|
-
spec.email = ["stevecrozz@gmail.com"]
|
|
11
|
-
spec.description = %q{Base to create an errbit plugin}
|
|
12
|
-
spec.summary = %q{Base to create an errbit plugin}
|
|
13
|
-
spec.homepage = "http://github.com/errbit/errbit"
|
|
14
|
-
spec.license = "MIT"
|
|
15
|
-
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
-
spec.require_paths = ["lib"]
|
|
20
|
-
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
|
22
|
-
spec.add_development_dependency "rake"
|
|
23
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module ErrbitPlugin
|
|
2
|
-
class NoneIssueTracker < IssueTracker
|
|
3
|
-
def self.label; 'none'; end
|
|
4
|
-
def self.note
|
|
5
|
-
'When no issue tracker has been configured, you will be able to ' <<
|
|
6
|
-
'leave comments on errors.'
|
|
7
|
-
end
|
|
8
|
-
def self.fields; {}; end
|
|
9
|
-
def self.icons
|
|
10
|
-
@icons ||= {
|
|
11
|
-
create: ['image/png', read_static_file('none_create.png')],
|
|
12
|
-
goto: ['image/png', read_static_file('none_create.png')],
|
|
13
|
-
inactive: ['image/png', read_static_file('none_inactive.png')],
|
|
14
|
-
}
|
|
15
|
-
end
|
|
16
|
-
def self.read_static_file(file)
|
|
17
|
-
File.read(File.expand_path(File.join(
|
|
18
|
-
File.dirname(__FILE__), '..', '..', '..', 'static', file)))
|
|
19
|
-
end
|
|
20
|
-
##
|
|
21
|
-
# The NoneIssueTracker is mark like configured? false because it not valid
|
|
22
|
-
# like a real IssueTracker
|
|
23
|
-
def configured?; false; end
|
|
24
|
-
def errors; {}; end
|
|
25
|
-
def url; ''; end
|
|
26
|
-
def create_issue(*); false; end
|
|
27
|
-
def close_issue(*); false; end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
ErrbitPlugin::Registry.add_issue_tracker(ErrbitPlugin::NoneIssueTracker)
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe ErrbitPlugin::Registry do
|
|
4
|
-
before do
|
|
5
|
-
ErrbitPlugin::Registry.clear_issue_trackers
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
let(:tracker) {
|
|
9
|
-
tracker = Class.new(ErrbitPlugin::IssueTracker) do
|
|
10
|
-
def self.label
|
|
11
|
-
'something'
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
tracker
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
describe ".add_issue_tracker" do
|
|
18
|
-
context "with issue_tracker class valid" do
|
|
19
|
-
before do
|
|
20
|
-
allow(ErrbitPlugin::ValidateIssueTracker)
|
|
21
|
-
.to receive(:new)
|
|
22
|
-
.with(tracker)
|
|
23
|
-
.and_return(double(:valid? => true, :message => ''))
|
|
24
|
-
end
|
|
25
|
-
it 'add new issue_tracker plugin' do
|
|
26
|
-
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
|
27
|
-
expect(ErrbitPlugin::Registry.issue_trackers).to eq({
|
|
28
|
-
'something' => tracker
|
|
29
|
-
})
|
|
30
|
-
end
|
|
31
|
-
context "with already issue_tracker with this key" do
|
|
32
|
-
it 'raise ErrbitPlugin::AlreadyRegisteredError' do
|
|
33
|
-
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
|
34
|
-
expect {
|
|
35
|
-
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
|
36
|
-
}.to raise_error(ErrbitPlugin::AlreadyRegisteredError)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
context "with an IssueTracker not valid" do
|
|
42
|
-
it 'raise an IncompatibilityError' do
|
|
43
|
-
allow(ErrbitPlugin::ValidateIssueTracker)
|
|
44
|
-
.to receive(:new)
|
|
45
|
-
.with(tracker)
|
|
46
|
-
.and_return(double(:valid? => false, :message => 'foo', :errors => []))
|
|
47
|
-
expect {
|
|
48
|
-
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
|
49
|
-
}.to raise_error(ErrbitPlugin::IncompatibilityError)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'puts the errors in the exception message' do
|
|
53
|
-
allow(ErrbitPlugin::ValidateIssueTracker)
|
|
54
|
-
.to receive(:new)
|
|
55
|
-
.with(tracker)
|
|
56
|
-
.and_return(double(:valid? => false, :message => 'foo', :errors => ['one', 'two']))
|
|
57
|
-
|
|
58
|
-
begin
|
|
59
|
-
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
|
60
|
-
rescue ErrbitPlugin::IncompatibilityError => e
|
|
61
|
-
expect(e.message).to eq('one; two')
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe ErrbitPlugin::ValidateIssueTracker do
|
|
4
|
-
describe "#valid?" do
|
|
5
|
-
|
|
6
|
-
context "with a complete class" do
|
|
7
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
8
|
-
def self.label; 'foo'; end
|
|
9
|
-
def self.note; 'foo'; end
|
|
10
|
-
def self.fields; ['foo']; end
|
|
11
|
-
def self.icons; {}; end
|
|
12
|
-
def configured?; true; end
|
|
13
|
-
def errors; true; end
|
|
14
|
-
def create_issue; 'http'; end
|
|
15
|
-
def close_issue; 'http'; end
|
|
16
|
-
def url; 'http'; end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'valid' do
|
|
20
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
context "with class not inherit from ErrbitPlugin::IssueTracker" do
|
|
25
|
-
klass = Class.new do
|
|
26
|
-
def self.label; 'foo'; end
|
|
27
|
-
def self.note; 'foo'; end
|
|
28
|
-
def self.fields; ['foo']; end
|
|
29
|
-
def self.icons; {}; end
|
|
30
|
-
def initialize(params); end
|
|
31
|
-
def configured?; true; end
|
|
32
|
-
def errors; true; end
|
|
33
|
-
def create_issue; 'http'; end
|
|
34
|
-
def close_issue; 'http'; end
|
|
35
|
-
def url; 'http'; end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it 'not valid' do
|
|
39
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it 'says :not_inherited' do
|
|
43
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
44
|
-
is.valid?
|
|
45
|
-
expect(is.errors).to eql [[:not_inherited]]
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
context "with no label method" do
|
|
50
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
51
|
-
def self.note; 'foo'; end
|
|
52
|
-
def self.fields; ['foo']; end
|
|
53
|
-
def self.icons; {}; end
|
|
54
|
-
def configured?; true; end
|
|
55
|
-
def errors; true; end
|
|
56
|
-
def create_issue; 'http'; end
|
|
57
|
-
def close_issue; 'http'; end
|
|
58
|
-
def url; 'http'; end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it 'not valid' do
|
|
62
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'say not implement label method' do
|
|
66
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
67
|
-
is.valid?
|
|
68
|
-
expect(is.errors).to eql [[:class_method_missing, :label]]
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
context "with no icons method" do
|
|
73
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
74
|
-
def self.note; 'foo'; end
|
|
75
|
-
def self.fields; ['foo']; end
|
|
76
|
-
def self.label; 'alabel'; end
|
|
77
|
-
def configured?; true; end
|
|
78
|
-
def errors; true; end
|
|
79
|
-
def create_issue; 'http'; end
|
|
80
|
-
def close_issue; 'http'; end
|
|
81
|
-
def url; 'http'; end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
it 'not valid' do
|
|
85
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'say not implement icons method' do
|
|
89
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
90
|
-
is.valid?
|
|
91
|
-
expect(is.errors).to eql [[:class_method_missing, :icons]]
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
context "without fields method" do
|
|
96
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
97
|
-
def self.label; 'foo'; end
|
|
98
|
-
def self.note; 'foo'; end
|
|
99
|
-
def self.icons; {}; end
|
|
100
|
-
def configured?; true; end
|
|
101
|
-
def errors; true; end
|
|
102
|
-
def create_issue; 'http'; end
|
|
103
|
-
def close_issue; 'http'; end
|
|
104
|
-
def url; 'http'; end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
it 'not valid' do
|
|
108
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
it 'say not implement fields method' do
|
|
112
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
113
|
-
is.valid?
|
|
114
|
-
expect(is.errors).to eql [[:class_method_missing, :fields]]
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
context "without configured? method" do
|
|
119
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
120
|
-
def self.label; 'foo'; end
|
|
121
|
-
def self.note; 'foo'; end
|
|
122
|
-
def self.fields; ['foo']; end
|
|
123
|
-
def self.icons; {}; end
|
|
124
|
-
def errors; true; end
|
|
125
|
-
def create_issue; 'http'; end
|
|
126
|
-
def close_issue; 'http'; end
|
|
127
|
-
def url; 'http'; end
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
it 'not valid' do
|
|
131
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
it 'say not implement configured? method' do
|
|
135
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
136
|
-
is.valid?
|
|
137
|
-
expect(is.errors).to eql [[:instance_method_missing, :configured?]]
|
|
138
|
-
end
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
context "without errors method" do
|
|
142
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
143
|
-
def self.label; 'foo'; end
|
|
144
|
-
def self.note; 'foo'; end
|
|
145
|
-
def self.fields; ['foo']; end
|
|
146
|
-
def self.icons; {}; end
|
|
147
|
-
def configured?; true; end
|
|
148
|
-
def create_issue; 'http'; end
|
|
149
|
-
def close_issue; 'http'; end
|
|
150
|
-
def url; 'http'; end
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
it 'not valid' do
|
|
154
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
it 'say not implement errors method' do
|
|
158
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
159
|
-
is.valid?
|
|
160
|
-
expect(is.errors).to eql [[:instance_method_missing, :errors]]
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
context "without create_issue method" do
|
|
165
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
166
|
-
def self.label; 'foo'; end
|
|
167
|
-
def self.note; 'foo'; end
|
|
168
|
-
def self.fields; ['foo']; end
|
|
169
|
-
def self.icons; {}; end
|
|
170
|
-
def configured?; true; end
|
|
171
|
-
def errors; true; end
|
|
172
|
-
def close_issue; 'http'; end
|
|
173
|
-
def url; 'http'; end
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
it 'not valid' do
|
|
177
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
178
|
-
end
|
|
179
|
-
it 'say not implement create_issue method' do
|
|
180
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
181
|
-
is.valid?
|
|
182
|
-
expect(is.errors).to eql [[:instance_method_missing, :create_issue]]
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
context "without close_issue method" do
|
|
187
|
-
# this is an optional method
|
|
188
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
189
|
-
def self.label; 'foo'; end
|
|
190
|
-
def self.note; 'foo'; end
|
|
191
|
-
def self.fields; ['foo']; end
|
|
192
|
-
def self.icons; {}; end
|
|
193
|
-
def configured?; true; end
|
|
194
|
-
def errors; true; end
|
|
195
|
-
def create_issue; 'http'; end
|
|
196
|
-
def url; 'http'; end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
it 'is valid' do
|
|
200
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true
|
|
201
|
-
end
|
|
202
|
-
it 'not say not implement close_issue method' do
|
|
203
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
204
|
-
is.valid?
|
|
205
|
-
expect(is.errors).not_to eql [[:instance_method_missing, :close_issue]]
|
|
206
|
-
end
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
context "without url method" do
|
|
210
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
211
|
-
def self.label; 'foo'; end
|
|
212
|
-
def self.note; 'foo'; end
|
|
213
|
-
def self.fields; ['foo']; end
|
|
214
|
-
def self.icons; {}; end
|
|
215
|
-
def configured?; true; end
|
|
216
|
-
def errors; true; end
|
|
217
|
-
def create_issue; 'http'; end
|
|
218
|
-
def close_issue; 'http'; end
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
it 'not valid' do
|
|
222
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
it 'say not implement url method' do
|
|
226
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
227
|
-
is.valid?
|
|
228
|
-
expect(is.errors).to eql [[:instance_method_missing, :url]]
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
context "without note method" do
|
|
233
|
-
klass = Class.new(ErrbitPlugin::IssueTracker) do
|
|
234
|
-
def self.label; 'foo'; end
|
|
235
|
-
def self.fields; ['foo']; end
|
|
236
|
-
def self.icons; {}; end
|
|
237
|
-
def configured?; true; end
|
|
238
|
-
def errors; true; end
|
|
239
|
-
def create_issue; 'http'; end
|
|
240
|
-
def close_issue; 'http'; end
|
|
241
|
-
def url; 'foo'; end
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
it 'not valid' do
|
|
245
|
-
expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
it 'say not implement note method' do
|
|
249
|
-
is = ErrbitPlugin::ValidateIssueTracker.new(klass)
|
|
250
|
-
is.valid?
|
|
251
|
-
expect(is.errors).to eql [[:class_method_missing, :note]]
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
|
-
end
|
|
255
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,26 +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
|
-
|
|
17
|
-
RSpec.configure do |config|
|
|
18
|
-
config.run_all_when_everything_filtered = true
|
|
19
|
-
config.filter_run :focus
|
|
20
|
-
|
|
21
|
-
# Run specs in random order to surface order dependencies. If you find an
|
|
22
|
-
# order dependency and want to debug it, you can fix the order by providing
|
|
23
|
-
# the seed, which is printed after each run.
|
|
24
|
-
# --seed 1234
|
|
25
|
-
config.order = 'random'
|
|
26
|
-
end
|