tmrw-cli 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e2a1301d0c6415f24b771e33fdbac1475b5cbea7e91bc86d450d5995cb2bab1c
4
+ data.tar.gz: 0e02099c36cea3850d99705f2b15faafd55ae5185791e731cee2ad3e65aeeaf5
5
+ SHA512:
6
+ metadata.gz: 308501df557110f9e5cda6560eff16bb98fe94360eb73c424bbc180d64b0f9e6e6d76e30ad1a43d7f7f7b47188030edb836574f90f440beb592835d2bbe1c64e
7
+ data.tar.gz: dc6236dd6c68de511b1b07d6655433faf3fb779bb73fe6d8e3bfd24dc5feb03177da5dac1e26b9e728d4ef149040775a6d9b6eaf4e3bd334219419e83639f486
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,556 @@
1
+ Naming/AccessorMethodName:
2
+ Description: Check the naming of accessor methods for get_/set_.
3
+ Enabled: false
4
+
5
+ Style/Alias:
6
+ Description: 'Use alias_method instead of alias.'
7
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
8
+ Enabled: false
9
+
10
+ Style/ArrayJoin:
11
+ Description: 'Use Array#join instead of Array#*.'
12
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
13
+ Enabled: false
14
+
15
+ Style/AsciiComments:
16
+ Description: 'Use only ascii symbols in comments.'
17
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
18
+ Enabled: false
19
+
20
+ Naming/AsciiIdentifiers:
21
+ Description: 'Use only ascii symbols in identifiers.'
22
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
23
+ Enabled: false
24
+
25
+ Style/Attr:
26
+ Description: 'Checks for uses of Module#attr.'
27
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
28
+ Enabled: false
29
+
30
+ Metrics/BlockNesting:
31
+ Description: 'Avoid excessive block nesting'
32
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
33
+ Enabled: false
34
+
35
+ Style/CaseEquality:
36
+ Description: 'Avoid explicit use of the case equality operator(===).'
37
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
38
+ Enabled: false
39
+
40
+ Style/CharacterLiteral:
41
+ Description: 'Checks for uses of character literals.'
42
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
43
+ Enabled: false
44
+
45
+ Style/ClassAndModuleChildren:
46
+ Description: 'Checks style of children classes and modules.'
47
+ Enabled: true
48
+ EnforcedStyle: nested
49
+
50
+ Metrics/ClassLength:
51
+ Description: 'Avoid classes longer than 100 lines of code.'
52
+ Enabled: false
53
+
54
+ Metrics/ModuleLength:
55
+ Description: 'Avoid modules longer than 100 lines of code.'
56
+ Enabled: false
57
+
58
+ Style/ClassVars:
59
+ Description: 'Avoid the use of class variables.'
60
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
61
+ Enabled: false
62
+
63
+ Style/CollectionMethods:
64
+ Enabled: true
65
+ PreferredMethods:
66
+ find: detect
67
+ inject: reduce
68
+ collect: map
69
+ find_all: select
70
+
71
+ Style/ColonMethodCall:
72
+ Description: 'Do not use :: for method call.'
73
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
74
+ Enabled: false
75
+
76
+ Style/CommentAnnotation:
77
+ Description: >-
78
+ Checks formatting of special comments
79
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
80
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
81
+ Enabled: false
82
+
83
+ Metrics/AbcSize:
84
+ Description: >-
85
+ A calculated magnitude based on number of assignments,
86
+ branches, and conditions.
87
+ Enabled: false
88
+
89
+ Metrics/BlockLength:
90
+ CountComments: true # count full line comments?
91
+ Max: 25
92
+ ExcludedMethods: []
93
+ Exclude:
94
+ - "spec/**/*"
95
+ - "*.gemspec"
96
+
97
+ Metrics/CyclomaticComplexity:
98
+ Description: >-
99
+ A complexity metric that is strongly correlated to the number
100
+ of test cases needed to validate a method.
101
+ Enabled: false
102
+
103
+
104
+ Style/PreferredHashMethods:
105
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
106
+ StyleGuide: '#hash-key'
107
+ Enabled: false
108
+
109
+ Style/Documentation:
110
+ Description: 'Document classes and non-namespace modules.'
111
+ Enabled: false
112
+
113
+ Style/DoubleNegation:
114
+ Description: 'Checks for uses of double negation (!!).'
115
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
116
+ Enabled: false
117
+
118
+ Style/EachWithObject:
119
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
120
+ Enabled: false
121
+
122
+ Style/EmptyLiteral:
123
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
124
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
125
+ Enabled: false
126
+
127
+ # Checks whether the source file has a utf-8 encoding comment or not
128
+ # AutoCorrectEncodingComment must match the regex
129
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
130
+ Style/Encoding:
131
+ Enabled: false
132
+
133
+ Style/EvenOdd:
134
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
135
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
136
+ Enabled: false
137
+
138
+ Naming/FileName:
139
+ Description: 'Use snake_case for source file names.'
140
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
141
+ Enabled: false
142
+
143
+ Style/FrozenStringLiteralComment:
144
+ Description: >-
145
+ Add the frozen_string_literal comment to the top of files
146
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
147
+ Enabled: false
148
+
149
+ Lint/FlipFlop:
150
+ Description: 'Checks for flip flops'
151
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
152
+ Enabled: false
153
+
154
+ Style/FormatString:
155
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
156
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
157
+ Enabled: false
158
+
159
+ Style/GlobalVars:
160
+ Description: 'Do not introduce global variables.'
161
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
162
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
163
+ Enabled: false
164
+
165
+ Style/GuardClause:
166
+ Description: 'Check for conditionals that can be replaced with guard clauses'
167
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
168
+ Enabled: false
169
+
170
+ Style/IfUnlessModifier:
171
+ Description: >-
172
+ Favor modifier if/unless usage when you have a
173
+ single-line body.
174
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
175
+ Enabled: false
176
+
177
+ Style/IfWithSemicolon:
178
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
179
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
180
+ Enabled: false
181
+
182
+ Style/InlineComment:
183
+ Description: 'Avoid inline comments.'
184
+ Enabled: false
185
+
186
+ Style/Lambda:
187
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
188
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
189
+ Enabled: false
190
+
191
+ Style/LambdaCall:
192
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
193
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
194
+ Enabled: false
195
+
196
+ Style/LineEndConcatenation:
197
+ Description: >-
198
+ Use \ instead of + or << to concatenate two string literals at
199
+ line end.
200
+ Enabled: false
201
+
202
+ Metrics/MethodLength:
203
+ Description: 'Avoid methods longer than 10 lines of code.'
204
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
205
+ Enabled: false
206
+
207
+ Style/ModuleFunction:
208
+ Description: 'Checks for usage of `extend self` in modules.'
209
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
210
+ Enabled: false
211
+
212
+ Style/MultilineBlockChain:
213
+ Description: 'Avoid multi-line chains of blocks.'
214
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
215
+ Enabled: false
216
+
217
+ Style/NegatedIf:
218
+ Description: >-
219
+ Favor unless over if for negative conditions
220
+ (or control flow or).
221
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
222
+ Enabled: false
223
+
224
+ Style/NegatedWhile:
225
+ Description: 'Favor until over while for negative conditions.'
226
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
227
+ Enabled: false
228
+
229
+ Style/Next:
230
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
231
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
232
+ Enabled: false
233
+
234
+ Style/NilComparison:
235
+ Description: 'Prefer x.nil? to x == nil.'
236
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
237
+ Enabled: false
238
+
239
+ Style/Not:
240
+ Description: 'Use ! instead of not.'
241
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
242
+ Enabled: false
243
+
244
+ Style/NumericLiterals:
245
+ Description: >-
246
+ Add underscores to large numeric literals to improve their
247
+ readability.
248
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
249
+ Enabled: false
250
+
251
+ Style/OneLineConditional:
252
+ Description: >-
253
+ Favor the ternary operator(?:) over
254
+ if/then/else/end constructs.
255
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
256
+ Enabled: false
257
+
258
+ Style/HashEachMethods:
259
+ Enabled: true
260
+
261
+ Style/HashTransformKeys:
262
+ Enabled: true
263
+
264
+ Style/HashTransformValues:
265
+ Enabled: true
266
+
267
+ Naming/BinaryOperatorParameterName:
268
+ Description: 'When defining binary operators, name the argument other.'
269
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
270
+ Enabled: false
271
+
272
+ Metrics/ParameterLists:
273
+ Description: 'Avoid parameter lists longer than three or four parameters.'
274
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
275
+ Enabled: false
276
+
277
+ Style/PercentLiteralDelimiters:
278
+ Description: 'Use `%`-literal delimiters consistently'
279
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
280
+ Enabled: false
281
+
282
+ Style/PerlBackrefs:
283
+ Description: 'Avoid Perl-style regex back references.'
284
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
285
+ Enabled: false
286
+
287
+ Naming/PredicateName:
288
+ Description: 'Check the names of predicate methods.'
289
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
290
+ ForbiddenPrefixes:
291
+ - is_
292
+ Exclude:
293
+ - spec/**/*
294
+
295
+ Style/Proc:
296
+ Description: 'Use proc instead of Proc.new.'
297
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
298
+ Enabled: false
299
+
300
+ Style/RaiseArgs:
301
+ Description: 'Checks the arguments passed to raise/fail.'
302
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
303
+ Enabled: false
304
+
305
+ Style/RegexpLiteral:
306
+ Description: 'Use / or %r around regular expressions.'
307
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
308
+ Enabled: false
309
+
310
+ Style/Sample:
311
+ Description: >-
312
+ Use `sample` instead of `shuffle.first`,
313
+ `shuffle.last`, and `shuffle[Fixnum]`.
314
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
315
+ Enabled: false
316
+
317
+ Style/SelfAssignment:
318
+ Description: >-
319
+ Checks for places where self-assignment shorthand should have
320
+ been used.
321
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
322
+ Enabled: false
323
+
324
+ Style/SingleLineBlockParams:
325
+ Description: 'Enforces the names of some block params.'
326
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
327
+ Enabled: false
328
+
329
+ Style/SingleLineMethods:
330
+ Description: 'Avoid single-line methods.'
331
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
332
+ Enabled: false
333
+
334
+ Style/SignalException:
335
+ Description: 'Checks for proper usage of fail and raise.'
336
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
337
+ Enabled: false
338
+
339
+ Style/SpecialGlobalVars:
340
+ Description: 'Avoid Perl-style global variables.'
341
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
342
+ Enabled: false
343
+
344
+ Style/StringLiterals:
345
+ Description: 'Checks if uses of quotes match the configured preference.'
346
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
347
+ EnforcedStyle: double_quotes
348
+ Enabled: true
349
+
350
+ Style/TrailingCommaInArguments:
351
+ Description: 'Checks for trailing comma in argument lists.'
352
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
353
+ EnforcedStyleForMultiline: comma
354
+ SupportedStylesForMultiline:
355
+ - comma
356
+ - consistent_comma
357
+ - no_comma
358
+ Enabled: true
359
+
360
+ Style/TrailingCommaInArrayLiteral:
361
+ Description: 'Checks for trailing comma in array literals.'
362
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
363
+ EnforcedStyleForMultiline: comma
364
+ SupportedStylesForMultiline:
365
+ - comma
366
+ - consistent_comma
367
+ - no_comma
368
+ Enabled: true
369
+
370
+ Style/TrailingCommaInHashLiteral:
371
+ Description: 'Checks for trailing comma in hash literals.'
372
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
373
+ EnforcedStyleForMultiline: comma
374
+ SupportedStylesForMultiline:
375
+ - comma
376
+ - consistent_comma
377
+ - no_comma
378
+ Enabled: true
379
+
380
+ Style/TrivialAccessors:
381
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
382
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
383
+ Enabled: false
384
+
385
+ Style/VariableInterpolation:
386
+ Description: >-
387
+ Don't interpolate global, instance and class variables
388
+ directly in strings.
389
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
390
+ Enabled: false
391
+
392
+ Style/WhenThen:
393
+ Description: 'Use when x then ... for one-line cases.'
394
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
395
+ Enabled: false
396
+
397
+ Style/WhileUntilModifier:
398
+ Description: >-
399
+ Favor modifier while/until usage when you have a
400
+ single-line body.
401
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
402
+ Enabled: false
403
+
404
+ Style/WordArray:
405
+ Description: 'Use %w or %W for arrays of words.'
406
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
407
+ Enabled: false
408
+
409
+ # Layout
410
+
411
+ Layout/ParameterAlignment:
412
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
413
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
414
+ Enabled: false
415
+
416
+ Layout/ConditionPosition:
417
+ Description: >-
418
+ Checks for condition placed in a confusing position relative to
419
+ the keyword.
420
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
421
+ Enabled: false
422
+
423
+ Layout/DotPosition:
424
+ Description: 'Checks the position of the dot in multi-line method calls.'
425
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
426
+ EnforcedStyle: trailing
427
+
428
+ Layout/ExtraSpacing:
429
+ Description: 'Do not use unnecessary spacing.'
430
+ Enabled: true
431
+
432
+ Layout/MultilineOperationIndentation:
433
+ Description: >-
434
+ Checks indentation of binary operations that span more than
435
+ one line.
436
+ Enabled: true
437
+ EnforcedStyle: indented
438
+
439
+ Layout/MultilineMethodCallIndentation:
440
+ Description: >-
441
+ Checks indentation of method calls with the dot operator
442
+ that span more than one line.
443
+ Enabled: true
444
+ EnforcedStyle: indented
445
+
446
+ Layout/InitialIndentation:
447
+ Description: >-
448
+ Checks the indentation of the first non-blank non-comment line in a file.
449
+ Enabled: false
450
+
451
+ Layout/LineLength:
452
+ Description: 'Limit lines to 80 characters.'
453
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
454
+ Max: 80
455
+
456
+ # Lint
457
+
458
+ Lint/AmbiguousOperator:
459
+ Description: >-
460
+ Checks for ambiguous operators in the first argument of a
461
+ method invocation without parentheses.
462
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
463
+ Enabled: false
464
+
465
+ Lint/AmbiguousRegexpLiteral:
466
+ Description: >-
467
+ Checks for ambiguous regexp literals in the first argument of
468
+ a method invocation without parenthesis.
469
+ Enabled: false
470
+
471
+ Lint/AssignmentInCondition:
472
+ Description: "Don't use assignment in conditions."
473
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
474
+ Enabled: false
475
+
476
+ Lint/CircularArgumentReference:
477
+ Description: "Don't refer to the keyword argument in the default value."
478
+ Enabled: false
479
+
480
+ Lint/DeprecatedClassMethods:
481
+ Description: 'Check for deprecated class method calls.'
482
+ Enabled: false
483
+
484
+ Lint/DuplicateHashKey:
485
+ Description: 'Check for duplicate keys in hash literals.'
486
+ Enabled: false
487
+
488
+ Lint/EachWithObjectArgument:
489
+ Description: 'Check for immutable argument given to each_with_object.'
490
+ Enabled: false
491
+
492
+ Lint/ElseLayout:
493
+ Description: 'Check for odd code arrangement in an else block.'
494
+ Enabled: false
495
+
496
+ Lint/FormatParameterMismatch:
497
+ Description: 'The number of parameters to format/sprint must match the fields.'
498
+ Enabled: false
499
+
500
+ Lint/SuppressedException:
501
+ Description: "Don't suppress exception."
502
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
503
+ Enabled: false
504
+
505
+ Lint/LiteralAsCondition:
506
+ Description: 'Checks of literals used in conditions.'
507
+ Enabled: false
508
+
509
+ Lint/LiteralInInterpolation:
510
+ Description: 'Checks for literals used in interpolation.'
511
+ Enabled: false
512
+
513
+ Lint/Loop:
514
+ Description: >-
515
+ Use Kernel#loop with break rather than begin/end/until or
516
+ begin/end/while for post-loop tests.
517
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
518
+ Enabled: false
519
+
520
+ Lint/NestedMethodDefinition:
521
+ Description: 'Do not use nested method definitions.'
522
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
523
+ Enabled: false
524
+
525
+ Lint/NonLocalExitFromIterator:
526
+ Description: 'Do not use return in iterator to cause non-local exit.'
527
+ Enabled: false
528
+
529
+ Lint/ParenthesesAsGroupedExpression:
530
+ Description: >-
531
+ Checks for method calls with a space before the opening
532
+ parenthesis.
533
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
534
+ Enabled: false
535
+
536
+ Lint/RequireParentheses:
537
+ Description: >-
538
+ Use parentheses in the method call to avoid confusion
539
+ about precedence.
540
+ Enabled: false
541
+
542
+ Lint/UnderscorePrefixedVariableName:
543
+ Description: 'Do not use prefix `_` for a variable that is used.'
544
+ Enabled: false
545
+
546
+ Lint/RedundantCopDisableDirective:
547
+ Description: >-
548
+ Checks for rubocop:disable comments that can be removed.
549
+ Note: this cop is not disabled when disabling all cops.
550
+ It must be explicitly disabled.
551
+ Enabled: false
552
+
553
+ Lint/Void:
554
+ Description: 'Possible use of operator/literal/variable in void context.'
555
+ Enabled: false
556
+
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.5
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in tmrw-cli.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,96 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tmrw-cli (0.1.0)
5
+ dry-cli (~> 0.4.0)
6
+ tty-markdown (~> 0.6.0)
7
+ tty-prompt (~> 0.20.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ast (2.4.0)
13
+ concurrent-ruby (1.1.6)
14
+ diff-lcs (1.3)
15
+ dry-cli (0.4.0)
16
+ concurrent-ruby (~> 1.0)
17
+ hanami-utils (~> 1.3)
18
+ equatable (0.6.1)
19
+ hanami-utils (1.3.6)
20
+ concurrent-ruby (~> 1.0)
21
+ transproc (~> 1.0)
22
+ jaro_winkler (1.5.4)
23
+ kramdown (1.16.2)
24
+ necromancer (0.5.1)
25
+ parallel (1.19.1)
26
+ parser (2.7.0.2)
27
+ ast (~> 2.4.0)
28
+ pastel (0.7.3)
29
+ equatable (~> 0.6)
30
+ tty-color (~> 0.5)
31
+ rainbow (3.0.0)
32
+ rake (10.5.0)
33
+ rexml (3.2.4)
34
+ rouge (3.16.0)
35
+ rspec (3.9.0)
36
+ rspec-core (~> 3.9.0)
37
+ rspec-expectations (~> 3.9.0)
38
+ rspec-mocks (~> 3.9.0)
39
+ rspec-core (3.9.1)
40
+ rspec-support (~> 3.9.1)
41
+ rspec-expectations (3.9.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.9.0)
44
+ rspec-mocks (3.9.1)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.9.0)
47
+ rspec-support (3.9.2)
48
+ rubocop (0.80.0)
49
+ jaro_winkler (~> 1.5.1)
50
+ parallel (~> 1.10)
51
+ parser (>= 2.7.0.1)
52
+ rainbow (>= 2.2.2, < 4.0)
53
+ rexml
54
+ ruby-progressbar (~> 1.7)
55
+ unicode-display_width (>= 1.4.0, < 1.7)
56
+ ruby-progressbar (1.10.1)
57
+ strings (0.1.8)
58
+ strings-ansi (~> 0.1)
59
+ unicode-display_width (~> 1.5)
60
+ unicode_utils (~> 1.4)
61
+ strings-ansi (0.2.0)
62
+ transproc (1.1.1)
63
+ tty-color (0.5.1)
64
+ tty-cursor (0.7.1)
65
+ tty-markdown (0.6.0)
66
+ kramdown (~> 1.16.2)
67
+ pastel (~> 0.7.2)
68
+ rouge (~> 3.3)
69
+ strings (~> 0.1.4)
70
+ tty-color (~> 0.4)
71
+ tty-screen (~> 0.6)
72
+ tty-prompt (0.20.0)
73
+ necromancer (~> 0.5.0)
74
+ pastel (~> 0.7.0)
75
+ tty-reader (~> 0.7.0)
76
+ tty-reader (0.7.0)
77
+ tty-cursor (~> 0.7)
78
+ tty-screen (~> 0.7)
79
+ wisper (~> 2.0.0)
80
+ tty-screen (0.7.1)
81
+ unicode-display_width (1.6.1)
82
+ unicode_utils (1.4.0)
83
+ wisper (2.0.1)
84
+
85
+ PLATFORMS
86
+ ruby
87
+
88
+ DEPENDENCIES
89
+ bundler (~> 2.0)
90
+ rake (~> 10.0)
91
+ rspec (~> 3.0)
92
+ rubocop (~> 0.80.0)
93
+ tmrw-cli!
94
+
95
+ BUNDLED WITH
96
+ 2.0.2
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Tmrw CLI
2
+
3
+ CLI tool for [TMRW](https://www.tomorrowhq.com).
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ gem install tmrw-cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```sh
14
+ tmrw
15
+ ```
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "tmrw"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require 'pry'
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/tmrw ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "tmrw"
4
+
5
+ Tmrw.start
data/lib/tmrw/cli.rb ADDED
@@ -0,0 +1,14 @@
1
+ module Tmrw
2
+ module CLI
3
+ extend Dry::CLI::Registry
4
+
5
+ register "publish", PublishCommand
6
+
7
+ if ENV["ALPHA"]
8
+ register "namespaces", NamespacesCommand
9
+ register "switch", SwitchCommand
10
+ register "containers", ContainersCommand
11
+ register "console", ConsoleCommand
12
+ end
13
+ end
14
+ end
data/lib/tmrw/color.rb ADDED
@@ -0,0 +1,17 @@
1
+ require "hanami/utils/shell_color"
2
+
3
+ module Tmrw
4
+ module Color
5
+ def green(text)
6
+ Hanami::Utils::ShellColor.call(text, color: :green)
7
+ end
8
+
9
+ def red(text)
10
+ Hanami::Utils::ShellColor.call(text, color: :red)
11
+ end
12
+
13
+ def blue(text)
14
+ Hanami::Utils::ShellColor.call(text, color: :blue)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,49 @@
1
+ require "readline"
2
+ require "tty-markdown"
3
+
4
+ module Tmrw
5
+ class ConsoleCommand < Dry::CLI::Command
6
+ include Color
7
+
8
+ desc "Tomorrow console"
9
+
10
+ def call(*)
11
+ @current_namespace_name = "tmrw"
12
+
13
+ loop do
14
+ prompt = "#{blue(@current_namespace_name)} > "
15
+ line = Readline.readline(prompt, true)
16
+ evaluate(line)
17
+ end
18
+ rescue Interrupt
19
+ print "\nBye. Exiting console\n"
20
+ end
21
+
22
+ private
23
+
24
+ def evaluate(command)
25
+ case command.strip
26
+ when "help"
27
+ doc = <<~MARKDOWN
28
+ __Commands:__
29
+
30
+ `namespaces` - returns list of avaliable namespaces
31
+ `switch` - switch between namespaces
32
+ `publish` - build image and push it to registry
33
+ `list` - list of availiable containers in namespace
34
+
35
+ To learn more about a command type `help [command]`
36
+ MARKDOWN
37
+
38
+ puts TTY::Markdown.parse(doc)
39
+ when "exit", "quit"
40
+ raise Interrupt
41
+ when "namespaces"
42
+ Tmrw::NamespacesCommand.new(command_name: "namespaces").call
43
+ else
44
+ puts "Unkown command"
45
+ puts "Enter help to see list of command"
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,27 @@
1
+ module Tmrw
2
+ class ContainersCommand < Dry::CLI::Command
3
+ include Color
4
+
5
+ desc "Manage containers"
6
+
7
+ def call(*)
8
+ puts "Containers:"
9
+ containers.each do |c|
10
+ if c[:status] == "running"
11
+ print c[:name], ": ", green(c[:status]), "\n"
12
+ else
13
+ print c[:name], ": ", red(c[:status]), "\n"
14
+ end
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def containers
21
+ [
22
+ { name: "hello", status: "running" },
23
+ { name: "broken-hello", status: "dead" },
24
+ ]
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,19 @@
1
+ module Tmrw
2
+ class DockerImage
3
+ attr_reader :tag
4
+
5
+ def initialize(tag:)
6
+ @tag = tag
7
+ end
8
+
9
+ def build!
10
+ ok = system("docker build -t #{tag} .")
11
+ raise "Failed to build docker image" unless ok
12
+ end
13
+
14
+ def push
15
+ ok = system("docker push #{tag}")
16
+ raise "Failed to push image to registry" unless ok
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,42 @@
1
+ module Tmrw
2
+ class NamespacesCommand < Dry::CLI::Command
3
+ include Color
4
+
5
+ desc "Manage namespaces"
6
+
7
+ def call(*)
8
+ puts "Namespaces:"
9
+
10
+ if namespaces.empty?
11
+ print color.dim("There are no namespaces\n\n")
12
+
13
+ return
14
+ end
15
+
16
+ namespaces.each do |namespace|
17
+ if namespace[:active]
18
+ puts green("> " + namespace[:name])
19
+ else
20
+ puts " " + namespace[:name]
21
+ end
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def create_namespace
28
+ result = TTY::Prompt.new.yes?("Do you want to create one?")
29
+ return unless result
30
+
31
+ name = TTY::Prompt.new.ask("How do you want to name it?")
32
+ puts "New #{green(name)} namespace was created"
33
+ end
34
+
35
+ def namespaces
36
+ [
37
+ { name: "tmrw", active: true },
38
+ { name: "demo", active: false },
39
+ ]
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,24 @@
1
+ module Tmrw
2
+ class PublishCommand < Dry::CLI::Command
3
+ include Color
4
+
5
+ desc "Publish application"
6
+
7
+ argument :name, desc: "Application name", required: true
8
+
9
+ def call(name:, **)
10
+ tag = "registry.tomorrowhq.com/#{name}:latest"
11
+ image = DockerImage.new(tag: tag)
12
+
13
+ puts blue("Building docker image:")
14
+ image.build!
15
+
16
+ puts blue("Pushing image to registry:")
17
+ image.push!
18
+
19
+ puts green("Completed!")
20
+ rescue StandardError => e
21
+ puts red(e.message)
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ module Tmrw
2
+ class SwitchCommand < Dry::CLI::Command
3
+ include Color
4
+
5
+ desc "Switch namespace"
6
+
7
+ argument :name, desc: "Name of the namespace", required: true
8
+
9
+ def call(name:, **)
10
+ print "You have switched to ", green(name), " namespace\n"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Tmrw
2
+ VERSION = "0.1.0".freeze
3
+ end
data/lib/tmrw.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "dry/cli"
2
+ require "tty-prompt"
3
+
4
+ require "tmrw/version"
5
+ require "tmrw/docker_image"
6
+ require "tmrw/color"
7
+ require "tmrw/namespaces_command"
8
+ require "tmrw/switch_command"
9
+ require "tmrw/publish_command"
10
+ require "tmrw/containers_command"
11
+ require "tmrw/console_command"
12
+ require "tmrw/cli"
13
+
14
+ module Tmrw
15
+ extend self
16
+
17
+ def start
18
+ Dry::CLI.new(Tmrw::CLI).call
19
+ end
20
+ end
data/tmrw-cli.gemspec ADDED
@@ -0,0 +1,38 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "tmrw/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "tmrw-cli"
7
+ spec.version = Tmrw::VERSION
8
+ spec.authors = ["Anton Volkov"]
9
+ spec.email = ["choixer@gmail.com"]
10
+
11
+ spec.summary = "TMRW CLI tool"
12
+ spec.description = "TMRW CLI tool that helps you to manage your projects"
13
+ spec.homepage = "https://www.tomorrowhq.com/cli"
14
+
15
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ # spec.metadata["source_code_uri"] = "https://.."
19
+ # spec.metadata["changelog_uri"] = "https://.."
20
+
21
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
+ `git ls-files -z`.split("\x0").reject do |file|
23
+ file.match(%r{^(test|spec|features)/})
24
+ end
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency "dry-cli", "~> 0.4.0"
31
+ spec.add_dependency "tty-markdown", "~> 0.6.0"
32
+ spec.add_dependency "tty-prompt", "~> 0.20.0"
33
+
34
+ spec.add_development_dependency "bundler", "~> 2.0"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "rubocop", "~> 0.80.0"
38
+ end
metadata ADDED
@@ -0,0 +1,164 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tmrw-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Anton Volkov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-02-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-cli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.4.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: tty-markdown
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.6.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: tty-prompt
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.20.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.20.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.80.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.80.0
111
+ description: TMRW CLI tool that helps you to manage your projects
112
+ email:
113
+ - choixer@gmail.com
114
+ executables:
115
+ - tmrw
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".gitignore"
120
+ - ".rspec"
121
+ - ".rubocop.yml"
122
+ - ".travis.yml"
123
+ - Gemfile
124
+ - Gemfile.lock
125
+ - README.md
126
+ - Rakefile
127
+ - bin/console
128
+ - bin/setup
129
+ - exe/tmrw
130
+ - lib/tmrw.rb
131
+ - lib/tmrw/cli.rb
132
+ - lib/tmrw/color.rb
133
+ - lib/tmrw/console_command.rb
134
+ - lib/tmrw/containers_command.rb
135
+ - lib/tmrw/docker_image.rb
136
+ - lib/tmrw/namespaces_command.rb
137
+ - lib/tmrw/publish_command.rb
138
+ - lib/tmrw/switch_command.rb
139
+ - lib/tmrw/version.rb
140
+ - tmrw-cli.gemspec
141
+ homepage: https://www.tomorrowhq.com/cli
142
+ licenses: []
143
+ metadata:
144
+ homepage_uri: https://www.tomorrowhq.com/cli
145
+ post_install_message:
146
+ rdoc_options: []
147
+ require_paths:
148
+ - lib
149
+ required_ruby_version: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ requirements: []
160
+ rubygems_version: 3.0.3
161
+ signing_key:
162
+ specification_version: 4
163
+ summary: TMRW CLI tool
164
+ test_files: []