tugboat 2.2.2 → 2.2.3

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.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +520 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +0 -6
  5. data/README.md +34 -2
  6. data/Rakefile +6 -1
  7. data/bin/tugboat +2 -2
  8. data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +1 -1
  9. data/features/cassettes/config/Single_SSH_key_as_number_in_config.yml +1 -1
  10. data/features/step_definitions/steps.rb +1 -1
  11. data/features/support/env.rb +7 -3
  12. data/lib/tugboat.rb +2 -2
  13. data/lib/tugboat/cli.rb +394 -444
  14. data/lib/tugboat/config.rb +43 -61
  15. data/lib/tugboat/middleware.rb +33 -33
  16. data/lib/tugboat/middleware/add_key.rb +12 -13
  17. data/lib/tugboat/middleware/ask_for_credentials.rb +12 -13
  18. data/lib/tugboat/middleware/base.rb +25 -20
  19. data/lib/tugboat/middleware/check_configuration.rb +3 -6
  20. data/lib/tugboat/middleware/check_credentials.rb +0 -1
  21. data/lib/tugboat/middleware/check_droplet_active.rb +2 -4
  22. data/lib/tugboat/middleware/check_droplet_inactive.rb +2 -4
  23. data/lib/tugboat/middleware/config.rb +3 -5
  24. data/lib/tugboat/middleware/confirm_action.rb +4 -6
  25. data/lib/tugboat/middleware/create_droplet.rb +27 -44
  26. data/lib/tugboat/middleware/custom_logger.rb +52 -54
  27. data/lib/tugboat/middleware/destroy_droplet.rb +5 -6
  28. data/lib/tugboat/middleware/destroy_image.rb +5 -6
  29. data/lib/tugboat/middleware/find_droplet.rb +43 -47
  30. data/lib/tugboat/middleware/find_image.rb +23 -29
  31. data/lib/tugboat/middleware/halt_droplet.rb +9 -10
  32. data/lib/tugboat/middleware/info_droplet.rb +30 -33
  33. data/lib/tugboat/middleware/info_image.rb +1 -1
  34. data/lib/tugboat/middleware/inject_client.rb +8 -10
  35. data/lib/tugboat/middleware/inject_configuration.rb +1 -2
  36. data/lib/tugboat/middleware/list_droplets.rb +9 -10
  37. data/lib/tugboat/middleware/list_images.rb +9 -9
  38. data/lib/tugboat/middleware/list_regions.rb +1 -1
  39. data/lib/tugboat/middleware/list_sizes.rb +1 -1
  40. data/lib/tugboat/middleware/list_ssh_keys.rb +1 -3
  41. data/lib/tugboat/middleware/password_reset.rb +6 -7
  42. data/lib/tugboat/middleware/rebuild_droplet.rb +7 -7
  43. data/lib/tugboat/middleware/resize_droplet.rb +6 -7
  44. data/lib/tugboat/middleware/restart_droplet.rb +4 -11
  45. data/lib/tugboat/middleware/snapshot_droplet.rb +7 -8
  46. data/lib/tugboat/middleware/ssh_droplet.rb +30 -31
  47. data/lib/tugboat/middleware/start_droplet.rb +5 -5
  48. data/lib/tugboat/middleware/wait_for_state.rb +2 -3
  49. data/lib/tugboat/version.rb +1 -1
  50. data/spec/cli/add_key_spec.rb +25 -28
  51. data/spec/cli/authorize_cli_spec.rb +57 -60
  52. data/spec/cli/config_cli_spec.rb +8 -11
  53. data/spec/cli/create_cli_spec.rb +40 -46
  54. data/spec/cli/debug_cli_spec.rb +29 -29
  55. data/spec/cli/destroy_cli_spec.rb +58 -60
  56. data/spec/cli/destroy_image_cli_spec.rb +42 -45
  57. data/spec/cli/droplets_cli_spec.rb +62 -64
  58. data/spec/cli/env_variable_spec.rb +14 -15
  59. data/spec/cli/halt_cli_spec.rb +65 -69
  60. data/spec/cli/help_cli_spec.rb +8 -8
  61. data/spec/cli/images_cli_spec.rb +28 -30
  62. data/spec/cli/info_cli_spec.rb +144 -147
  63. data/spec/cli/info_image_cli_spec.rb +57 -60
  64. data/spec/cli/keys_cli_spec.rb +8 -10
  65. data/spec/cli/password_reset_cli_spec.rb +56 -56
  66. data/spec/cli/rebuild_cli_spec.rb +194 -198
  67. data/spec/cli/regions_cli_spec.rb +8 -8
  68. data/spec/cli/resize_cli_spec.rb +54 -56
  69. data/spec/cli/restart_cli_spec.rb +53 -57
  70. data/spec/cli/sizes_cli_spec.rb +7 -8
  71. data/spec/cli/snapshot_cli_spec.rb +50 -53
  72. data/spec/cli/ssh_cli_spec.rb +41 -42
  73. data/spec/cli/start_cli_spec.rb +48 -52
  74. data/spec/cli/verify_cli_spec.rb +22 -25
  75. data/spec/cli/version_cli_spec.rb +6 -8
  76. data/spec/cli/wait_cli_spec.rb +50 -52
  77. data/spec/config_spec.rb +56 -57
  78. data/spec/middleware/base_spec.rb +5 -6
  79. data/spec/middleware/check_configuration_spec.rb +5 -7
  80. data/spec/middleware/check_credentials_spec.rb +9 -10
  81. data/spec/middleware/check_droplet_active_spec.rb +5 -7
  82. data/spec/middleware/check_droplet_inactive_spec.rb +5 -7
  83. data/spec/middleware/find_droplet_spec.rb +4 -5
  84. data/spec/middleware/find_image_spec.rb +4 -5
  85. data/spec/middleware/inject_client_spec.rb +9 -12
  86. data/spec/middleware/inject_configuration_spec.rb +4 -7
  87. data/spec/middleware/ssh_droplet_spec.rb +70 -73
  88. data/spec/shared/environment.rb +18 -20
  89. data/spec/spec_helper.rb +4 -4
  90. data/tugboat.gemspec +10 -6
  91. metadata +88 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6428d7db68bbe83c97c4ea846c48542fd3f24e55
4
- data.tar.gz: 8d4f05eb934fbd78f4c1ed9fa855199997da618b
3
+ metadata.gz: 926a79e11c4d8990c022963a3b5430ace08410dd
4
+ data.tar.gz: f4aa2dcbefb3b6cef51453c5ae1eed9a94e31b85
5
5
  SHA512:
6
- metadata.gz: d4b7cca6b0f09a5bdb596a575637dc608cf900d68316dd99fc090f4eafc6f0d7f978858d6e4ba516b8dc5df09de7669f30ddf0cdeb9d407213a2470563d646bc
7
- data.tar.gz: a62193e3c38db585fca1f09756df0ddcbb90e070c78f40d85fff9311c91393f92fbfd84604c41956ab1f0f1f3b83e2de32c236d1c2bc60adc3e03cfeb5a95c78
6
+ metadata.gz: a472043ac5591ed9d3e3e2856b1fa824a5cf8a95079d76f3d40edef1a0e6727c561c74455a5d1aae161a6a37926d090def9dba0865b8c76e9e4ea5942fcb9b15
7
+ data.tar.gz: 4b78af8dd27e3d0023b97e17434fa762a41b3bc7ace550cfa2576992ac5ad5cc010f8b0accf698a18b1d8b132460f1c888eb3e5f43787073d6a22d01dfc1b5a9
data/.rubocop.yml ADDED
@@ -0,0 +1,520 @@
1
+ require: rubocop-rspec
2
+ AllCops:
3
+ TargetRubyVersion: 1.9
4
+ Include:
5
+ - ./**/*.rb
6
+ Exclude:
7
+ - files/**/*
8
+ - vendor/**/*
9
+ - .vendor/**/*
10
+ - pkg/**/*
11
+ - spec/fixtures/**/*
12
+ Lint/ConditionPosition:
13
+ Enabled: True
14
+
15
+ Lint/ElseLayout:
16
+ Enabled: True
17
+
18
+ Lint/UnreachableCode:
19
+ Enabled: True
20
+
21
+ Lint/UselessComparison:
22
+ Enabled: True
23
+
24
+ Lint/EnsureReturn:
25
+ Enabled: True
26
+
27
+ Lint/HandleExceptions:
28
+ Enabled: True
29
+
30
+ Lint/LiteralInCondition:
31
+ Enabled: True
32
+
33
+ Lint/ShadowingOuterLocalVariable:
34
+ Enabled: True
35
+
36
+ Lint/LiteralInInterpolation:
37
+ Enabled: True
38
+
39
+ Style/HashSyntax:
40
+ Enabled: True
41
+
42
+ Style/RedundantReturn:
43
+ Enabled: True
44
+
45
+ Lint/AmbiguousOperator:
46
+ Enabled: True
47
+
48
+ Lint/AssignmentInCondition:
49
+ Enabled: True
50
+
51
+ Style/SpaceBeforeComment:
52
+ Enabled: True
53
+
54
+ Style/AndOr:
55
+ Enabled: True
56
+
57
+ Style/RedundantSelf:
58
+ Enabled: True
59
+
60
+ Metrics/BlockLength:
61
+ Enabled: False
62
+
63
+ # Method length is not necessarily an indicator of code quality
64
+ Metrics/MethodLength:
65
+ Enabled: False
66
+
67
+ # Module length is not necessarily an indicator of code quality
68
+ Metrics/ModuleLength:
69
+ Enabled: False
70
+
71
+ Style/WhileUntilModifier:
72
+ Enabled: True
73
+
74
+ Lint/AmbiguousRegexpLiteral:
75
+ Enabled: True
76
+
77
+ Security/Eval:
78
+ Enabled: True
79
+
80
+ Lint/BlockAlignment:
81
+ Enabled: True
82
+
83
+ Lint/DefEndAlignment:
84
+ Enabled: True
85
+
86
+ Lint/EndAlignment:
87
+ Enabled: True
88
+
89
+ Lint/DeprecatedClassMethods:
90
+ Enabled: True
91
+
92
+ Lint/Loop:
93
+ Enabled: True
94
+
95
+ Lint/ParenthesesAsGroupedExpression:
96
+ Enabled: True
97
+
98
+ Lint/RescueException:
99
+ Enabled: True
100
+
101
+ Lint/StringConversionInInterpolation:
102
+ Enabled: True
103
+
104
+ Lint/UnusedBlockArgument:
105
+ Enabled: True
106
+
107
+ Lint/UnusedMethodArgument:
108
+ Enabled: True
109
+
110
+ Lint/UselessAccessModifier:
111
+ Enabled: True
112
+
113
+ Lint/UselessAssignment:
114
+ Enabled: True
115
+
116
+ Lint/Void:
117
+ Enabled: True
118
+
119
+ Style/AccessModifierIndentation:
120
+ Enabled: True
121
+
122
+ Style/AccessorMethodName:
123
+ Enabled: True
124
+
125
+ Style/Alias:
126
+ Enabled: True
127
+
128
+ Style/AlignArray:
129
+ Enabled: True
130
+
131
+ Style/AlignHash:
132
+ Enabled: True
133
+
134
+ Style/AlignParameters:
135
+ Enabled: True
136
+
137
+ Metrics/BlockNesting:
138
+ Enabled: True
139
+
140
+ Style/AsciiComments:
141
+ Enabled: True
142
+
143
+ Style/Attr:
144
+ Enabled: True
145
+
146
+ Style/BracesAroundHashParameters:
147
+ Enabled: True
148
+
149
+ Style/CaseEquality:
150
+ Enabled: True
151
+
152
+ Style/CaseIndentation:
153
+ Enabled: True
154
+
155
+ Style/CharacterLiteral:
156
+ Enabled: True
157
+
158
+ Style/ClassAndModuleCamelCase:
159
+ Enabled: True
160
+
161
+ Style/ClassAndModuleChildren:
162
+ Enabled: False
163
+
164
+ Style/ClassCheck:
165
+ Enabled: True
166
+
167
+ # Class length is not necessarily an indicator of code quality
168
+ Metrics/ClassLength:
169
+ Enabled: False
170
+
171
+ Style/ClassMethods:
172
+ Enabled: True
173
+
174
+ Style/ClassVars:
175
+ Enabled: True
176
+
177
+ Style/WhenThen:
178
+ Enabled: True
179
+
180
+ Style/WordArray:
181
+ Enabled: True
182
+
183
+ Style/UnneededPercentQ:
184
+ Enabled: True
185
+
186
+ Style/Tab:
187
+ Enabled: True
188
+
189
+ Style/SpaceBeforeSemicolon:
190
+ Enabled: True
191
+
192
+ Style/TrailingBlankLines:
193
+ Enabled: True
194
+
195
+ Style/SpaceInsideBlockBraces:
196
+ Enabled: True
197
+
198
+ Style/SpaceInsideBrackets:
199
+ Enabled: True
200
+
201
+ Style/SpaceInsideHashLiteralBraces:
202
+ Enabled: True
203
+
204
+ Style/SpaceInsideParens:
205
+ Enabled: True
206
+
207
+ Style/LeadingCommentSpace:
208
+ Enabled: True
209
+
210
+ Style/SpaceBeforeFirstArg:
211
+ Enabled: True
212
+
213
+ Style/SpaceAfterColon:
214
+ Enabled: True
215
+
216
+ Style/SpaceAfterComma:
217
+ Enabled: True
218
+
219
+ Style/SpaceAfterMethodName:
220
+ Enabled: True
221
+
222
+ Style/SpaceAfterNot:
223
+ Enabled: True
224
+
225
+ Style/SpaceAfterSemicolon:
226
+ Enabled: True
227
+
228
+ Style/SpaceAroundEqualsInParameterDefault:
229
+ Enabled: True
230
+
231
+ Style/SpaceAroundOperators:
232
+ Enabled: True
233
+
234
+ Style/SpaceBeforeBlockBraces:
235
+ Enabled: True
236
+
237
+ Style/SpaceBeforeComma:
238
+ Enabled: True
239
+
240
+ Style/CollectionMethods:
241
+ Enabled: True
242
+
243
+ Style/CommentIndentation:
244
+ Enabled: True
245
+
246
+ Style/ColonMethodCall:
247
+ Enabled: True
248
+
249
+ Style/CommentAnnotation:
250
+ Enabled: True
251
+
252
+ # 'Complexity' is very relative
253
+ Metrics/CyclomaticComplexity:
254
+ Enabled: False
255
+
256
+ Style/ConstantName:
257
+ Enabled: True
258
+
259
+ Style/Documentation:
260
+ Enabled: False
261
+
262
+ Style/DefWithParentheses:
263
+ Enabled: True
264
+
265
+ Style/PreferredHashMethods:
266
+ Enabled: True
267
+
268
+ Style/DotPosition:
269
+ EnforcedStyle: trailing
270
+
271
+ Style/DoubleNegation:
272
+ Enabled: True
273
+
274
+ Style/EachWithObject:
275
+ Enabled: True
276
+
277
+ Style/EmptyLineBetweenDefs:
278
+ Enabled: True
279
+
280
+ Style/IndentArray:
281
+ Enabled: True
282
+
283
+ Style/IndentHash:
284
+ Enabled: True
285
+
286
+ Style/IndentationConsistency:
287
+ Enabled: True
288
+
289
+ Style/IndentationWidth:
290
+ Enabled: True
291
+
292
+ Style/EmptyLines:
293
+ Enabled: True
294
+
295
+ Style/EmptyLinesAroundAccessModifier:
296
+ Enabled: True
297
+
298
+ Style/EmptyLiteral:
299
+ Enabled: True
300
+
301
+ # Configuration parameters: AllowURI, URISchemes.
302
+ Metrics/LineLength:
303
+ Enabled: False
304
+
305
+ Style/MethodCallWithoutArgsParentheses:
306
+ Enabled: True
307
+
308
+ Style/MethodDefParentheses:
309
+ Enabled: True
310
+
311
+ Style/LineEndConcatenation:
312
+ Enabled: True
313
+
314
+ Style/TrailingWhitespace:
315
+ Enabled: True
316
+
317
+ Style/StringLiterals:
318
+ Enabled: True
319
+
320
+ Style/TrailingCommaInArguments:
321
+ Enabled: True
322
+
323
+ Style/TrailingCommaInLiteral:
324
+ Enabled: True
325
+
326
+ Style/GlobalVars:
327
+ Enabled: True
328
+
329
+ Style/GuardClause:
330
+ Enabled: True
331
+
332
+ Style/IfUnlessModifier:
333
+ Enabled: True
334
+
335
+ Style/MultilineIfThen:
336
+ Enabled: True
337
+
338
+ Style/NegatedIf:
339
+ Enabled: True
340
+
341
+ Style/NegatedWhile:
342
+ Enabled: True
343
+
344
+ Style/Next:
345
+ Enabled: True
346
+
347
+ Style/SingleLineBlockParams:
348
+ Enabled: True
349
+
350
+ Style/SingleLineMethods:
351
+ Enabled: True
352
+
353
+ Style/SpecialGlobalVars:
354
+ Enabled: True
355
+
356
+ Style/TrivialAccessors:
357
+ Enabled: True
358
+
359
+ Style/UnlessElse:
360
+ Enabled: True
361
+
362
+ Style/VariableInterpolation:
363
+ Enabled: True
364
+
365
+ Style/VariableName:
366
+ Enabled: True
367
+
368
+ Style/WhileUntilDo:
369
+ Enabled: True
370
+
371
+ Style/EvenOdd:
372
+ Enabled: True
373
+
374
+ Style/FileName:
375
+ Enabled: True
376
+
377
+ Style/For:
378
+ Enabled: True
379
+
380
+ Style/Lambda:
381
+ Enabled: True
382
+
383
+ Style/MethodName:
384
+ Enabled: True
385
+
386
+ Style/MultilineTernaryOperator:
387
+ Enabled: True
388
+
389
+ Style/NestedTernaryOperator:
390
+ Enabled: True
391
+
392
+ Style/NilComparison:
393
+ Enabled: True
394
+
395
+ Style/FormatString:
396
+ Enabled: True
397
+
398
+ Style/MultilineBlockChain:
399
+ Enabled: True
400
+
401
+ Style/Semicolon:
402
+ Enabled: True
403
+
404
+ Style/SignalException:
405
+ Enabled: True
406
+
407
+ Style/NonNilCheck:
408
+ Enabled: True
409
+
410
+ Style/Not:
411
+ Enabled: True
412
+
413
+ Style/NumericLiterals:
414
+ Enabled: True
415
+
416
+ Style/OneLineConditional:
417
+ Enabled: True
418
+
419
+ Style/OpMethod:
420
+ Enabled: True
421
+
422
+ Style/ParenthesesAroundCondition:
423
+ Enabled: True
424
+
425
+ Style/PercentLiteralDelimiters:
426
+ Enabled: True
427
+
428
+ Style/PerlBackrefs:
429
+ Enabled: True
430
+
431
+ Style/PredicateName:
432
+ Enabled: True
433
+
434
+ Style/RedundantException:
435
+ Enabled: True
436
+
437
+ Style/SelfAssignment:
438
+ Enabled: True
439
+
440
+ Style/Proc:
441
+ Enabled: True
442
+
443
+ Style/RaiseArgs:
444
+ Enabled: True
445
+
446
+ Style/RedundantBegin:
447
+ Enabled: True
448
+
449
+ Style/RescueModifier:
450
+ Enabled: True
451
+
452
+ # based on https://github.com/voxpupuli/modulesync_config/issues/168
453
+ Style/RegexpLiteral:
454
+ EnforcedStyle: percent_r
455
+ Enabled: True
456
+
457
+ Lint/UnderscorePrefixedVariableName:
458
+ Enabled: True
459
+
460
+ Metrics/ParameterLists:
461
+ Enabled: False
462
+
463
+ Lint/RequireParentheses:
464
+ Enabled: True
465
+
466
+ Style/SpaceBeforeFirstArg:
467
+ Enabled: True
468
+
469
+ Style/ModuleFunction:
470
+ Enabled: True
471
+
472
+ Lint/Debugger:
473
+ Enabled: True
474
+
475
+ Style/IfWithSemicolon:
476
+ Enabled: True
477
+
478
+ Style/Encoding:
479
+ Enabled: True
480
+
481
+ Style/BlockDelimiters:
482
+ Enabled: True
483
+
484
+ Style/MultilineBlockLayout:
485
+ Enabled: True
486
+
487
+ # 'Complexity' is very relative
488
+ Metrics/AbcSize:
489
+ Enabled: False
490
+
491
+ # 'Complexity' is very relative
492
+ Metrics/PerceivedComplexity:
493
+ Enabled: False
494
+
495
+ Lint/UselessAssignment:
496
+ Enabled: True
497
+
498
+ Style/ClosingParenthesisIndentation:
499
+ Enabled: True
500
+
501
+ # RSpec
502
+
503
+ # We don't use rspec in this way
504
+ RSpec/DescribeClass:
505
+ Enabled: False
506
+
507
+ # Example length is not necessarily an indicator of code quality
508
+ RSpec/ExampleLength:
509
+ Enabled: False
510
+
511
+ RSpec/NamedSubject:
512
+ Enabled: False
513
+
514
+ # disabled for now since they cause a lot of issues
515
+ # these issues aren't easy to fix
516
+ RSpec/RepeatedDescription:
517
+ Enabled: False
518
+
519
+ RSpec/NestedGroups:
520
+ Enabled: False