dogapi 1.28.0 → 1.29.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: 94170fa0c3d3afae7fe1c1b1fac4bd16570f9bf9
4
- data.tar.gz: c1d8f67c1edc5864146403efcdda5626afa42ba6
2
+ SHA256:
3
+ metadata.gz: 6f0f9e8378ef6450f007c59b5e410d59360bb2bd809becc6d4ebcd15060df07d
4
+ data.tar.gz: 29364635da8174b284769e719a436b7346bb675879fc7425a60ee1d412b0f944
5
5
  SHA512:
6
- metadata.gz: 27a4a92628e88d8c4de9ca4c39511d38528b641f2bdd4114dbdef8bb47ca76b4a2d69b7f499d25e8e9fd07f56c5ae4616eb768bc4ff79bb661abbed334c814b0
7
- data.tar.gz: 93b1e477f449399b2954cf68d615f3c8cf7c0950ef771a6220ad1677d6d26ddc27e3fdbe21b9e93ba989cc6ada268afc791f33ab3a9da11a8ed8326a577b8e42
6
+ metadata.gz: ee6435510b755900b09b2fd718d31a349b22a8022534cd47569f36be300a40df5513b9b3310a76faa766bbedf098952fcf4fbe39d1ee347faac8e90a9348699f
7
+ data.tar.gz: d717fa7164731b77a7105f98dda7f5ad41581daa3c0e05389073bf4636f1328e60aeecdee6d1738843b1027a6567c1a5cd72bc8bda3a76c754d72dadd9a14f51
@@ -1,15 +1,178 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-05-17 13:09:19 -0400 using RuboCop version 0.41.2.
3
+ # on 2018-03-23 17:40:12 -0400 using RuboCop version 0.49.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 3
10
+ # Configuration parameters: Include.
11
+ # Include: **/Gemfile, **/gems.rb
12
+ Bundler/DuplicatedGem:
13
+ Exclude:
14
+ - 'Gemfile'
15
+
16
+ # Offense count: 1
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: Include, TreatCommentsAsGroupSeparators.
19
+ # Include: **/Gemfile, **/gems.rb
20
+ Bundler/OrderedGems:
21
+ Exclude:
22
+ - 'Gemfile'
23
+
24
+ # Offense count: 7
25
+ # Cop supports --auto-correct.
26
+ # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
27
+ # SupportedStyles: with_first_parameter, with_fixed_indentation
28
+ Layout/AlignParameters:
29
+ Exclude:
30
+ - 'lib/capistrano/datadog.rb'
31
+ - 'lib/dogapi/event.rb'
32
+
33
+ # Offense count: 3
34
+ # Cop supports --auto-correct.
35
+ Layout/ClosingParenthesisIndentation:
36
+ Exclude:
37
+ - 'examples/custom_event.rb'
38
+ - 'lib/capistrano/datadog.rb'
39
+
40
+ # Offense count: 1
41
+ # Cop supports --auto-correct.
42
+ Layout/CommentIndentation:
43
+ Exclude:
44
+ - 'lib/dogapi/event.rb'
45
+
46
+ # Offense count: 3
47
+ # Cop supports --auto-correct.
48
+ Layout/EmptyLineAfterMagicComment:
49
+ Exclude:
50
+ - 'dogapi.gemspec'
51
+ - 'spec/integration/comment_spec.rb'
52
+ - 'spec/integration/event_spec.rb'
53
+
54
+ # Offense count: 2
55
+ # Cop supports --auto-correct.
56
+ Layout/EmptyLines:
57
+ Exclude:
58
+ - 'lib/capistrano/datadog/v2.rb'
59
+ - 'lib/dogapi/facade.rb'
60
+
61
+ # Offense count: 60
62
+ # Cop supports --auto-correct.
63
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
64
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
65
+ Layout/EmptyLinesAroundClassBody:
66
+ Enabled: false
67
+
68
+ # Offense count: 1
69
+ # Cop supports --auto-correct.
70
+ Layout/EmptyLinesAroundMethodBody:
71
+ Exclude:
72
+ - 'lib/dogapi/facade.rb'
73
+
74
+ # Offense count: 5
75
+ # Cop supports --auto-correct.
76
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
77
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
78
+ Layout/EmptyLinesAroundModuleBody:
79
+ Exclude:
80
+ - 'lib/capistrano/datadog.rb'
81
+ - 'lib/dogapi/common.rb'
82
+ - 'lib/dogapi/event.rb'
83
+ - 'lib/dogapi/facade.rb'
84
+ - 'lib/dogapi/metric.rb'
85
+
86
+ # Offense count: 1
87
+ # Cop supports --auto-correct.
88
+ # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
89
+ Layout/ExtraSpacing:
90
+ Exclude:
91
+ - 'lib/capistrano/datadog/v2.rb'
92
+
93
+ # Offense count: 2
94
+ # Cop supports --auto-correct.
95
+ # Configuration parameters: SupportedStyles, IndentationWidth.
96
+ # SupportedStyles: special_inside_parentheses, consistent, align_braces
97
+ Layout/IndentHash:
98
+ EnforcedStyle: consistent
99
+
100
+ # Offense count: 1
101
+ # Cop supports --auto-correct.
102
+ # Configuration parameters: Width, IgnoredPatterns.
103
+ Layout/IndentationWidth:
104
+ Exclude:
105
+ - 'lib/capistrano/datadog.rb'
106
+
107
+ # Offense count: 3
108
+ # Cop supports --auto-correct.
109
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
110
+ # SupportedStyles: symmetrical, new_line, same_line
111
+ Layout/MultilineMethodCallBraceLayout:
112
+ Exclude:
113
+ - 'examples/custom_event.rb'
114
+ - 'lib/capistrano/datadog.rb'
115
+
116
+ # Offense count: 2
117
+ # Cop supports --auto-correct.
118
+ # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
119
+ # SupportedStyles: aligned, indented
120
+ Layout/MultilineOperationIndentation:
121
+ Exclude:
122
+ - 'dogapi.gemspec'
123
+
9
124
  # Offense count: 1
10
125
  # Cop supports --auto-correct.
11
- # Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
12
- # SupportedStyles: keyword, variable, start_of_line
126
+ Layout/SpaceAfterComma:
127
+ Exclude:
128
+ - 'examples/custom_metric.rb'
129
+
130
+ # Offense count: 75
131
+ # Cop supports --auto-correct.
132
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
133
+ # SupportedStyles: space, no_space
134
+ Layout/SpaceAroundEqualsInParameterDefault:
135
+ Exclude:
136
+ - 'lib/capistrano/datadog.rb'
137
+ - 'lib/capistrano/datadog/v2.rb'
138
+ - 'lib/dogapi/common.rb'
139
+ - 'lib/dogapi/event.rb'
140
+ - 'lib/dogapi/facade.rb'
141
+ - 'lib/dogapi/v1/dash.rb'
142
+ - 'lib/dogapi/v1/embed.rb'
143
+ - 'lib/dogapi/v1/event.rb'
144
+ - 'lib/dogapi/v1/metric.rb'
145
+ - 'lib/dogapi/v1/snapshot.rb'
146
+ - 'lib/dogapi/v1/tag.rb'
147
+ - 'lib/dogapi/v1/user.rb'
148
+
149
+ # Offense count: 2
150
+ # Cop supports --auto-correct.
151
+ # Configuration parameters: AllowForAlignment.
152
+ Layout/SpaceAroundOperators:
153
+ Exclude:
154
+ - 'examples/custom_metric.rb'
155
+ - 'lib/dogapi/event.rb'
156
+
157
+ # Offense count: 1
158
+ # Cop supports --auto-correct.
159
+ # Configuration parameters: AllowForAlignment.
160
+ Layout/SpaceBeforeFirstArg:
161
+ Exclude:
162
+ - 'lib/capistrano/datadog/v2.rb'
163
+
164
+ # Offense count: 1
165
+ # Cop supports --auto-correct.
166
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
167
+ # SupportedStyles: final_newline, final_blank_line
168
+ Layout/TrailingBlankLines:
169
+ Exclude:
170
+ - 'examples/Capfile'
171
+
172
+ # Offense count: 1
173
+ # Cop supports --auto-correct.
174
+ # Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
175
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
13
176
  Lint/EndAlignment:
14
177
  Exclude:
15
178
  - 'lib/capistrano/datadog.rb'
@@ -30,6 +193,7 @@ Lint/RescueException:
30
193
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
31
194
  Lint/UnusedBlockArgument:
32
195
  Exclude:
196
+ - 'examples/Capfile'
33
197
  - 'lib/capistrano/datadog/v2.rb'
34
198
 
35
199
  # Offense count: 1
@@ -48,10 +212,10 @@ Lint/UselessAssignment:
48
212
  Metrics/AbcSize:
49
213
  Max: 50
50
214
 
51
- # Offense count: 1
52
- # Configuration parameters: CountComments.
53
- Metrics/ClassLength:
54
- Max: 269
215
+ # Offense count: 15
216
+ # Configuration parameters: CountComments, ExcludedMethods.
217
+ Metrics/BlockLength:
218
+ Max: 96
55
219
 
56
220
  # Offense count: 1
57
221
  Metrics/CyclomaticComplexity:
@@ -71,7 +235,7 @@ Metrics/ParameterLists:
71
235
  Metrics/PerceivedComplexity:
72
236
  Max: 8
73
237
 
74
- # Offense count: 10
238
+ # Offense count: 11
75
239
  Style/AccessorMethodName:
76
240
  Exclude:
77
241
  - 'lib/dogapi/facade.rb'
@@ -89,15 +253,6 @@ Style/Alias:
89
253
  Exclude:
90
254
  - 'lib/capistrano/datadog/v3.rb'
91
255
 
92
- # Offense count: 7
93
- # Cop supports --auto-correct.
94
- # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
95
- # SupportedStyles: with_first_parameter, with_fixed_indentation
96
- Style/AlignParameters:
97
- Exclude:
98
- - 'lib/capistrano/datadog.rb'
99
- - 'lib/dogapi/event.rb'
100
-
101
256
  # Offense count: 6
102
257
  # Cop supports --auto-correct.
103
258
  # Configuration parameters: EnforcedStyle, SupportedStyles.
@@ -137,12 +292,6 @@ Style/ClassVars:
137
292
  Exclude:
138
293
  - 'lib/dogapi/common.rb'
139
294
 
140
- # Offense count: 3
141
- # Cop supports --auto-correct.
142
- Style/ClosingParenthesisIndentation:
143
- Exclude:
144
- - 'lib/capistrano/datadog.rb'
145
-
146
295
  # Offense count: 3
147
296
  # Cop supports --auto-correct.
148
297
  Style/ColonMethodCall:
@@ -161,19 +310,13 @@ Style/CommandLiteral:
161
310
 
162
311
  # Offense count: 1
163
312
  # Cop supports --auto-correct.
164
- Style/CommentIndentation:
165
- Exclude:
166
- - 'lib/dogapi/event.rb'
167
-
168
- # Offense count: 1
169
- # Cop supports --auto-correct.
170
- # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
313
+ # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
171
314
  # SupportedStyles: assign_to_condition, assign_inside_condition
172
315
  Style/ConditionalAssignment:
173
316
  Exclude:
174
317
  - 'lib/capistrano/datadog.rb'
175
318
 
176
- # Offense count: 18
319
+ # Offense count: 19
177
320
  # Cop supports --auto-correct.
178
321
  Style/DefWithParentheses:
179
322
  Exclude:
@@ -203,52 +346,12 @@ Style/Documentation:
203
346
  - 'lib/dogapi/v1/snapshot.rb'
204
347
  - 'lib/dogapi/v1/user.rb'
205
348
 
206
- # Offense count: 3
207
- # Cop supports --auto-correct.
208
- Style/EmptyLines:
209
- Exclude:
210
- - 'Rakefile'
211
- - 'lib/capistrano/datadog/v2.rb'
212
- - 'lib/dogapi/facade.rb'
213
-
214
- # Offense count: 56
215
- # Cop supports --auto-correct.
216
- # Configuration parameters: EnforcedStyle, SupportedStyles.
217
- # SupportedStyles: empty_lines, no_empty_lines
218
- Style/EmptyLinesAroundClassBody:
219
- Enabled: false
220
-
221
- # Offense count: 1
222
- # Cop supports --auto-correct.
223
- Style/EmptyLinesAroundMethodBody:
224
- Exclude:
225
- - 'lib/dogapi/facade.rb'
226
-
227
- # Offense count: 5
228
- # Cop supports --auto-correct.
229
- # Configuration parameters: EnforcedStyle, SupportedStyles.
230
- # SupportedStyles: empty_lines, no_empty_lines
231
- Style/EmptyLinesAroundModuleBody:
232
- Exclude:
233
- - 'lib/capistrano/datadog.rb'
234
- - 'lib/dogapi/common.rb'
235
- - 'lib/dogapi/event.rb'
236
- - 'lib/dogapi/facade.rb'
237
- - 'lib/dogapi/metric.rb'
238
-
239
349
  # Offense count: 1
240
350
  # Cop supports --auto-correct.
241
351
  Style/EmptyLiteral:
242
352
  Exclude:
243
353
  - 'lib/dogapi/v1/metric.rb'
244
354
 
245
- # Offense count: 1
246
- # Cop supports --auto-correct.
247
- # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
248
- Style/ExtraSpacing:
249
- Exclude:
250
- - 'lib/capistrano/datadog/v2.rb'
251
-
252
355
  # Offense count: 2
253
356
  # Configuration parameters: MinBodyLength.
254
357
  Style/GuardClause:
@@ -259,9 +362,12 @@ Style/GuardClause:
259
362
  # Offense count: 86
260
363
  # Cop supports --auto-correct.
261
364
  # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
262
- # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
365
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
263
366
  Style/HashSyntax:
264
367
  Exclude:
368
+ - 'Rakefile'
369
+ - 'examples/custom_event.rb'
370
+ - 'examples/custom_metric.rb'
265
371
  - 'lib/capistrano/datadog.rb'
266
372
  - 'lib/dogapi/event.rb'
267
373
  - 'lib/dogapi/facade.rb'
@@ -274,11 +380,12 @@ Style/HashSyntax:
274
380
  - 'lib/dogapi/v1/snapshot.rb'
275
381
  - 'lib/dogapi/v1/tag.rb'
276
382
 
277
- # Offense count: 15
383
+ # Offense count: 16
278
384
  # Cop supports --auto-correct.
279
385
  # Configuration parameters: MaxLineLength.
280
386
  Style/IfUnlessModifier:
281
387
  Exclude:
388
+ - 'Gemfile'
282
389
  - 'lib/capistrano/datadog.rb'
283
390
  - 'lib/capistrano/datadog/v2.rb'
284
391
  - 'lib/capistrano/datadog/v3.rb'
@@ -290,21 +397,13 @@ Style/IfUnlessModifier:
290
397
 
291
398
  # Offense count: 2
292
399
  # Cop supports --auto-correct.
293
- # Configuration parameters: SupportedStyles, IndentationWidth.
294
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
295
- Style/IndentHash:
296
- EnforcedStyle: consistent
297
-
298
- # Offense count: 1
299
- # Cop supports --auto-correct.
300
- # Configuration parameters: Width.
301
- Style/IndentationWidth:
400
+ Style/LineEndConcatenation:
302
401
  Exclude:
303
- - 'lib/capistrano/datadog.rb'
402
+ - 'dogapi.gemspec'
304
403
 
305
- # Offense count: 13
404
+ # Offense count: 14
306
405
  # Cop supports --auto-correct.
307
- Style/MethodCallParentheses:
406
+ Style/MethodCallWithoutArgsParentheses:
308
407
  Exclude:
309
408
  - 'lib/dogapi/common.rb'
310
409
  - 'lib/dogapi/event.rb'
@@ -317,21 +416,15 @@ Style/MultilineIfThen:
317
416
  Exclude:
318
417
  - 'lib/capistrano/datadog.rb'
319
418
 
320
- # Offense count: 3
321
- # Cop supports --auto-correct.
322
- # Configuration parameters: EnforcedStyle, SupportedStyles.
323
- # SupportedStyles: symmetrical, new_line, same_line
324
- Style/MultilineMethodCallBraceLayout:
325
- Exclude:
326
- - 'lib/capistrano/datadog.rb'
327
-
328
- # Offense count: 17
419
+ # Offense count: 20
329
420
  # Cop supports --auto-correct.
330
421
  Style/MutableConstant:
331
422
  Enabled: false
332
423
 
333
424
  # Offense count: 2
334
425
  # Cop supports --auto-correct.
426
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
427
+ # SupportedStyles: both, prefix, postfix
335
428
  Style/NegatedIf:
336
429
  Exclude:
337
430
  - 'lib/dogapi/common.rb'
@@ -343,16 +436,20 @@ Style/Not:
343
436
  Exclude:
344
437
  - 'lib/dogapi/v1/metric.rb'
345
438
 
346
- # Offense count: 2
439
+ # Offense count: 5
347
440
  # Cop supports --auto-correct.
348
441
  # Configuration parameters: PreferredDelimiters.
349
442
  Style/PercentLiteralDelimiters:
350
443
  Exclude:
351
444
  - 'lib/capistrano/datadog.rb'
352
445
  - 'lib/dogapi/common.rb'
446
+ - 'spec/integration/event_spec.rb'
447
+ - 'spec/integration/monitor_spec.rb'
353
448
 
354
449
  # Offense count: 2
355
450
  # Cop supports --auto-correct.
451
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
452
+ # SupportedStyles: short, verbose
356
453
  Style/PreferredHashMethods:
357
454
  Exclude:
358
455
  - 'lib/dogapi/common.rb'
@@ -388,51 +485,31 @@ Style/SelfAssignment:
388
485
  - 'lib/dogapi/event.rb'
389
486
  - 'lib/dogapi/v1/event.rb'
390
487
 
391
- # Offense count: 75
392
- # Cop supports --auto-correct.
393
- # Configuration parameters: EnforcedStyle, SupportedStyles.
394
- # SupportedStyles: space, no_space
395
- Style/SpaceAroundEqualsInParameterDefault:
396
- Exclude:
397
- - 'lib/capistrano/datadog.rb'
398
- - 'lib/capistrano/datadog/v2.rb'
399
- - 'lib/dogapi/common.rb'
400
- - 'lib/dogapi/event.rb'
401
- - 'lib/dogapi/facade.rb'
402
- - 'lib/dogapi/v1/dash.rb'
403
- - 'lib/dogapi/v1/embed.rb'
404
- - 'lib/dogapi/v1/event.rb'
405
- - 'lib/dogapi/v1/metric.rb'
406
- - 'lib/dogapi/v1/snapshot.rb'
407
- - 'lib/dogapi/v1/tag.rb'
408
- - 'lib/dogapi/v1/user.rb'
409
-
410
- # Offense count: 2
411
- # Cop supports --auto-correct.
412
- # Configuration parameters: AllowForAlignment.
413
- Style/SpaceAroundOperators:
414
- Exclude:
415
- - 'lib/dogapi/event.rb'
416
-
417
488
  # Offense count: 1
418
489
  # Cop supports --auto-correct.
419
- # Configuration parameters: AllowForAlignment.
420
- Style/SpaceBeforeFirstArg:
490
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
491
+ # SupportedStyles: use_perl_names, use_english_names
492
+ Style/SpecialGlobalVars:
421
493
  Exclude:
422
- - 'lib/capistrano/datadog/v2.rb'
494
+ - 'dogapi.gemspec'
423
495
 
424
- # Offense count: 21
496
+ # Offense count: 23
425
497
  # Cop supports --auto-correct.
426
498
  # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
427
499
  # SupportedStyles: single_quotes, double_quotes
428
500
  Style/StringLiterals:
429
501
  Exclude:
502
+ - 'Gemfile'
503
+ - 'Rakefile'
504
+ - 'dogapi.gemspec'
505
+ - 'examples/Capfile'
506
+ - 'examples/custom_event.rb'
430
507
  - 'lib/dogapi/event.rb'
431
508
 
432
509
  # Offense count: 10
433
510
  # Cop supports --auto-correct.
434
- # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
435
- # SupportedStyles: comma, consistent_comma, no_comma
511
+ # Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
512
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
436
513
  Style/TrailingCommaInLiteral:
437
514
  Exclude:
438
515
  - 'lib/dogapi/event.rb'
@@ -443,13 +520,20 @@ Style/TrailingCommaInLiteral:
443
520
  - 'lib/dogapi/v1/snapshot.rb'
444
521
  - 'lib/dogapi/v1/user.rb'
445
522
 
446
- # Offense count: 2
523
+ # Offense count: 3
447
524
  # Cop supports --auto-correct.
448
- # Configuration parameters: SupportedStyles, WordRegex.
525
+ # Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex.
449
526
  # SupportedStyles: percent, brackets
450
527
  Style/WordArray:
451
- EnforcedStyle: percent
452
- MinSize: -Infinity
528
+ Exclude:
529
+ - 'Rakefile'
530
+ - 'examples/custom_event.rb'
531
+
532
+ # Offense count: 1
533
+ # Cop supports --auto-correct.
534
+ Style/YodaCondition:
535
+ Exclude:
536
+ - 'lib/dogapi/common.rb'
453
537
 
454
538
  # Offense count: 1
455
539
  # Cop supports --auto-correct.
@@ -1,9 +1,16 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 1.9
5
4
  - 2.0
6
5
  - 2.1
7
6
  - 2.2
8
7
  - 2.3
9
8
  - 2.4
9
+ - 2.5
10
+ script: bundle exec rake $TASK
11
+ env:
12
+ - TASK=spec
13
+ matrix:
14
+ include:
15
+ env: TASK=rubocop
16
+ rvm: 2.5
@@ -1,6 +1,11 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ # 1.29.0 / 2018-03-23
5
+
6
+ * [FEATURE] Add new endpoints for dashboard lists.
7
+ * [IMPROVEMENT] change http-method GET to POST on api.Screenboard#share. See [#136][] (thanks [@haohcraft][])
8
+
4
9
  # 1.28.0 / 2017-08-16
5
10
 
6
11
  * [FEATURE] Accept `group_states` strings for `get_monitor` function. See [#132][] (thanks [@acroos][])
@@ -190,6 +195,7 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
190
195
  [#127]: https://github.com/DataDog/dogapi-rb/issues/127
191
196
  [#132]: https://github.com/DataDog/dogapi-rb/issues/132
192
197
  [#133]: https://github.com/DataDog/dogapi-rb/issues/133
198
+ [#136]: https://github.com/DataDog/dogapi-rb/issues/136
193
199
  [@ArjenSchwarz]: https://github.com/ArjenSchwarz
194
200
  [@Kaixiang]: https://github.com/Kaixiang
195
201
  [@acroos]: https://github.com/acroos
@@ -198,6 +204,7 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
198
204
  [@blakehilscher]: https://github.com/blakehilscher
199
205
  [@byroot]: https://github.com/byroot
200
206
  [@casperisfine]: https://github.com/casperisfine
207
+ [@haohcraft]: https://github.com/haohcraft
201
208
  [@hnovikov]: https://github.com/hnovikov
202
209
  [@jimmyngo]: https://github.com/jimmyngo
203
210
  [@martinisoft]: https://github.com/martinisoft
@@ -206,4 +213,4 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
206
213
  [@rmoriz]: https://github.com/rmoriz
207
214
  [@treeder]: https://github.com/treeder
208
215
  [@winebarrel]: https://github.com/winebarrel
209
- [@yyuu]: https://github.com/yyuu
216
+ [@yyuu]: https://github.com/yyuu
data/Gemfile CHANGED
@@ -3,22 +3,9 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :test do
6
+ gem 'rubocop', "~> 0.49.0"
6
7
  gem 'rake', '>= 2.4.2'
7
8
  gem 'rspec'
8
- gem 'rubocop', '~> 0.41.2'
9
9
  gem 'simplecov'
10
- if RbConfig::CONFIG['ruby_version'].start_with?("1.9")
11
- gem 'json', '< 2'
12
- gem 'public_suffix', '< 1.5'
13
- gem 'rdoc', '< 5'
14
- gem 'term-ansicolor', '< 1.4'
15
- gem 'webmock', '< 2.3'
16
- gem 'nokogiri', '< 1.7'
17
- gem 'tins', '~> 1.6.0'
18
- elsif RbConfig::CONFIG['ruby_version'].start_with?("2.0")
19
- gem 'nokogiri', '< 1.7'
20
- gem 'webmock'
21
- else
22
- gem 'webmock'
23
- end
10
+ gem 'webmock'
24
11
  end
data/Rakefile CHANGED
@@ -2,9 +2,8 @@ require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
3
  require 'rdoc/task'
4
4
  require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
5
 
7
- task :default => [:spec, :rubocop]
6
+ task :default => :spec
8
7
 
9
8
  # Doc stuff
10
9
  RDoc::Task.new do |rd|
@@ -17,11 +16,11 @@ end
17
16
 
18
17
  RSpec::Core::RakeTask.new(:spec)
19
18
 
20
- RuboCop::RakeTask.new do |task|
21
- task.patterns = ['spec', 'lib']
22
- end
23
-
24
19
  desc "Find notes in code"
25
20
  task :notes do
26
21
  puts `grep --exclude=Rakefile -r 'OPTIMIZE:\\|FIXME:\\|TODO:' .`
27
22
  end
23
+
24
+ task :rubocop do
25
+ sh "rubocop"
26
+ end
@@ -33,6 +33,9 @@ module Dogapi
33
33
  @comment_svc = Dogapi::V1::CommentService.new(@api_key, @application_key, silent, timeout, @datadog_host)
34
34
  @search_svc = Dogapi::V1::SearchService.new(@api_key, @application_key, silent, timeout, @datadog_host)
35
35
  @dash_service = Dogapi::V1::DashService.new(@api_key, @application_key, silent, timeout, @datadog_host)
36
+ @dashboard_list_service = Dogapi::V1::DashboardListService.new(
37
+ @api_key, @application_key, silent, timeout, @datadog_host
38
+ )
36
39
  @alert_svc = Dogapi::V1::AlertService.new(@api_key, @application_key, silent, timeout, @datadog_host)
37
40
  @user_svc = Dogapi::V1::UserService.new(@api_key, @application_key, silent, timeout, @datadog_host)
38
41
  @snapshot_svc = Dogapi::V1::SnapshotService.new(@api_key, @application_key, silent, timeout, @datadog_host)
@@ -271,6 +274,46 @@ module Dogapi
271
274
  @dash_service.delete_dashboard(dash_id)
272
275
  end
273
276
 
277
+ #
278
+ # DASHBOARD LISTS
279
+ #
280
+
281
+ def create_dashboard_list(name)
282
+ @dashboard_list_service.create(name)
283
+ end
284
+
285
+ def update_dashboard_list(dashboard_list_id, name)
286
+ @dashboard_list_service.update(dashboard_list_id, name)
287
+ end
288
+
289
+ def get_dashboard_list(dashboard_list_id)
290
+ @dashboard_list_service.get(dashboard_list_id)
291
+ end
292
+
293
+ def get_all_dashboard_lists()
294
+ @dashboard_list_service.all()
295
+ end
296
+
297
+ def delete_dashboard_list(dashboard_list_id)
298
+ @dashboard_list_service.delete(dashboard_list_id)
299
+ end
300
+
301
+ def add_items_to_dashboard_list(dashboard_list_id, dashboards)
302
+ @dashboard_list_service.add_items(dashboard_list_id, dashboards)
303
+ end
304
+
305
+ def update_items_of_dashboard_list(dashboard_list_id, dashboards)
306
+ @dashboard_list_service.update_items(dashboard_list_id, dashboards)
307
+ end
308
+
309
+ def delete_items_from_dashboard_list(dashboard_list_id, dashboards)
310
+ @dashboard_list_service.delete_items(dashboard_list_id, dashboards)
311
+ end
312
+
313
+ def get_items_of_dashboard_list(dashboard_list_id)
314
+ @dashboard_list_service.get_items(dashboard_list_id)
315
+ end
316
+
274
317
  #
275
318
  # ALERTS
276
319
  #
@@ -1,6 +1,7 @@
1
1
  require 'dogapi/v1/alert'
2
2
  require 'dogapi/v1/comment'
3
3
  require 'dogapi/v1/dash'
4
+ require 'dogapi/v1/dashboard_list'
4
5
  require 'dogapi/v1/embed'
5
6
  require 'dogapi/v1/event'
6
7
  require 'dogapi/v1/metadata'
@@ -0,0 +1,96 @@
1
+ require 'dogapi'
2
+
3
+ module Dogapi
4
+ class V1 # for namespacing
5
+
6
+ # Dashboard List API
7
+ class DashboardListService < Dogapi::APIService
8
+
9
+ API_VERSION = 'v1'
10
+ RESOURCE_NAME = 'dashboard/lists/manual'
11
+ SUB_RESOURCE_NAME = 'dashboards'
12
+
13
+ def create(name)
14
+ body = {
15
+ name: name
16
+ }
17
+
18
+ request(Net::HTTP::Post, "/api/#{API_VERSION}/#{RESOURCE_NAME}", nil, body, true)
19
+ end
20
+
21
+ def update(resource_id, name)
22
+ body = {
23
+ name: name
24
+ }
25
+
26
+ request(Net::HTTP::Put, "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}", nil, body, true)
27
+ end
28
+
29
+ def get(resource_id)
30
+ request(Net::HTTP::Get, "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}", nil, nil, false)
31
+ end
32
+
33
+ def all
34
+ request(Net::HTTP::Get, "/api/#{API_VERSION}/#{RESOURCE_NAME}", nil, nil, false)
35
+ end
36
+
37
+ def delete(resource_id)
38
+ request(Net::HTTP::Delete, "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}", nil, nil, false)
39
+ end
40
+
41
+ def get_items(resource_id)
42
+ request(
43
+ Net::HTTP::Get,
44
+ "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}/#{SUB_RESOURCE_NAME}",
45
+ nil,
46
+ nil,
47
+ false
48
+ )
49
+ end
50
+
51
+ def add_items(resource_id, dashboards)
52
+ body = {
53
+ dashboards: dashboards
54
+ }
55
+
56
+ request(
57
+ Net::HTTP::Post,
58
+ "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}/#{SUB_RESOURCE_NAME}",
59
+ nil,
60
+ body,
61
+ true
62
+ )
63
+ end
64
+
65
+ def update_items(resource_id, dashboards)
66
+ body = {
67
+ dashboards: dashboards
68
+ }
69
+
70
+ request(
71
+ Net::HTTP::Put,
72
+ "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}/#{SUB_RESOURCE_NAME}",
73
+ nil,
74
+ body,
75
+ true
76
+ )
77
+ end
78
+
79
+ def delete_items(resource_id, dashboards)
80
+ body = {
81
+ dashboards: dashboards
82
+ }
83
+
84
+ request(
85
+ Net::HTTP::Delete,
86
+ "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{resource_id}/#{SUB_RESOURCE_NAME}",
87
+ nil,
88
+ body,
89
+ true
90
+ )
91
+ end
92
+
93
+ end
94
+
95
+ end
96
+ end
@@ -28,7 +28,7 @@ module Dogapi
28
28
  end
29
29
 
30
30
  def share_screenboard(board_id)
31
- request(Net::HTTP::Get, "/api/#{API_VERSION}/screen/share/#{board_id}", nil, nil, false)
31
+ request(Net::HTTP::Post, "/api/#{API_VERSION}/screen/share/#{board_id}", nil, nil, false)
32
32
  end
33
33
 
34
34
  def revoke_screenboard(board_id)
@@ -1,3 +1,3 @@
1
1
  module Dogapi
2
- VERSION = '1.28.0'
2
+ VERSION = '1.29.0'
3
3
  end
@@ -0,0 +1,85 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe Dogapi::Client do
4
+ RESOURCE_NAME = 'dashboard/lists/manual'.freeze
5
+ SUB_RESOURCE_NAME = 'dashboards'.freeze
6
+
7
+ DASHBOARD_LIST_ID = 1_234_567
8
+ DASHBOARD_LIST_NAME = 'My new dashboard list'.freeze
9
+
10
+ DASHBOARDS = [
11
+ {
12
+ 'type' => 'custom_timeboard',
13
+ 'id' => 1234
14
+ },
15
+ {
16
+ 'type' => 'custom_screenboard',
17
+ 'id' => 1234
18
+ }
19
+ ].freeze
20
+
21
+ DASHBOARD_LIST_BODY = {
22
+ name: DASHBOARD_LIST_NAME
23
+ }.freeze
24
+
25
+ DASHBOARD_LIST_WITH_DASHES_BODY = {
26
+ dashboards: DASHBOARDS
27
+ }.freeze
28
+
29
+ describe '#create_dashboard_list' do
30
+ it_behaves_like 'an api method',
31
+ :create_dashboard_list, [DASHBOARD_LIST_NAME],
32
+ :post, "/#{RESOURCE_NAME}", DASHBOARD_LIST_BODY
33
+ end
34
+
35
+ describe '#update_dashboard_list' do
36
+ it_behaves_like 'an api method',
37
+ :update_dashboard_list, [DASHBOARD_LIST_ID] + [DASHBOARD_LIST_NAME],
38
+ :put, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}", DASHBOARD_LIST_BODY
39
+ end
40
+
41
+ describe '#get_dashboard_list' do
42
+ it_behaves_like 'an api method',
43
+ :get_dashboard_list, [DASHBOARD_LIST_ID],
44
+ :get, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}"
45
+ end
46
+
47
+ describe '#get_all_dashboard_lists' do
48
+ it_behaves_like 'an api method',
49
+ :get_all_dashboard_lists, [],
50
+ :get, "/#{RESOURCE_NAME}"
51
+ end
52
+
53
+ describe '#delete_dashboard_list' do
54
+ it_behaves_like 'an api method',
55
+ :delete_dashboard_list, [DASHBOARD_LIST_ID],
56
+ :delete, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}"
57
+ end
58
+
59
+ describe '#add_items_to_dashboard_list' do
60
+ it_behaves_like 'an api method',
61
+ :add_items_to_dashboard_list, [DASHBOARD_LIST_ID] + [DASHBOARDS],
62
+ :post, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}/#{SUB_RESOURCE_NAME}",
63
+ DASHBOARD_LIST_WITH_DASHES_BODY
64
+ end
65
+
66
+ describe '#update_items_of_dashboard_list' do
67
+ it_behaves_like 'an api method',
68
+ :update_items_of_dashboard_list, [DASHBOARD_LIST_ID] + [DASHBOARDS],
69
+ :put, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}/#{SUB_RESOURCE_NAME}",
70
+ DASHBOARD_LIST_WITH_DASHES_BODY
71
+ end
72
+
73
+ describe '#delete_items_from_dashboard_list' do
74
+ it_behaves_like 'an api method',
75
+ :delete_items_from_dashboard_list, [DASHBOARD_LIST_ID] + [DASHBOARDS],
76
+ :delete, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}/#{SUB_RESOURCE_NAME}",
77
+ DASHBOARD_LIST_WITH_DASHES_BODY
78
+ end
79
+
80
+ describe '#get_items_of_dashboard_list' do
81
+ it_behaves_like 'an api method',
82
+ :get_items_of_dashboard_list, [DASHBOARD_LIST_ID],
83
+ :get, "/#{RESOURCE_NAME}/#{DASHBOARD_LIST_ID}/#{SUB_RESOURCE_NAME}"
84
+ end
85
+ end
@@ -50,7 +50,7 @@ describe Dogapi::Client do
50
50
  describe '#share_screenboard' do
51
51
  it_behaves_like 'an api method',
52
52
  :share_screenboard, [BOARD_ID],
53
- :get, "/screen/share/#{BOARD_ID}"
53
+ :post, "/screen/share/#{BOARD_ID}"
54
54
  end
55
55
 
56
56
  describe '#revoke_screenboard' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-16 00:00:00.000000000 Z
11
+ date: 2018-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -102,6 +102,7 @@ files:
102
102
  - lib/dogapi/v1/alert.rb
103
103
  - lib/dogapi/v1/comment.rb
104
104
  - lib/dogapi/v1/dash.rb
105
+ - lib/dogapi/v1/dashboard_list.rb
105
106
  - lib/dogapi/v1/embed.rb
106
107
  - lib/dogapi/v1/event.rb
107
108
  - lib/dogapi/v1/metadata.rb
@@ -118,6 +119,7 @@ files:
118
119
  - spec/integration/comment_spec.rb
119
120
  - spec/integration/common_spec.rb
120
121
  - spec/integration/dash_spec.rb
122
+ - spec/integration/dashboard_list_spec.rb
121
123
  - spec/integration/embed_spec.rb
122
124
  - spec/integration/event_spec.rb
123
125
  - spec/integration/metadata_spec.rb
@@ -158,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
160
  version: '0'
159
161
  requirements: []
160
162
  rubyforge_project:
161
- rubygems_version: 2.6.8
163
+ rubygems_version: 2.7.1
162
164
  signing_key:
163
165
  specification_version: 4
164
166
  summary: Ruby bindings for Datadog's API
@@ -167,6 +169,7 @@ test_files:
167
169
  - spec/integration/comment_spec.rb
168
170
  - spec/integration/common_spec.rb
169
171
  - spec/integration/dash_spec.rb
172
+ - spec/integration/dashboard_list_spec.rb
170
173
  - spec/integration/embed_spec.rb
171
174
  - spec/integration/event_spec.rb
172
175
  - spec/integration/metadata_spec.rb
@@ -181,4 +184,3 @@ test_files:
181
184
  - spec/spec_helper.rb
182
185
  - spec/unit/common_spec.rb
183
186
  - spec/unit/facade_spec.rb
184
- has_rdoc: true