travis-cl 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +134 -0
  3. data/Gemfile +11 -0
  4. data/Gemfile.lock +59 -0
  5. data/MIT_LICENSE.md +21 -0
  6. data/README.md +1283 -0
  7. data/cl.gemspec +30 -0
  8. data/examples/README.md +22 -0
  9. data/examples/_src/args/cast.erb.rb +100 -0
  10. data/examples/_src/args/opts.erb.rb +100 -0
  11. data/examples/_src/args/required.erb.rb +63 -0
  12. data/examples/_src/args/splat.erb.rb +55 -0
  13. data/examples/_src/gem.erb.rb +99 -0
  14. data/examples/_src/heroku.erb.rb +47 -0
  15. data/examples/_src/rakeish.erb.rb +54 -0
  16. data/examples/_src/readme/abstract.erb.rb +27 -0
  17. data/examples/_src/readme/alias.erb.rb +22 -0
  18. data/examples/_src/readme/arg.erb.rb +21 -0
  19. data/examples/_src/readme/arg_array.erb.rb +21 -0
  20. data/examples/_src/readme/arg_type.erb.rb +23 -0
  21. data/examples/_src/readme/args_splat.erb.rb +55 -0
  22. data/examples/_src/readme/array.erb.rb +21 -0
  23. data/examples/_src/readme/basic.erb.rb +72 -0
  24. data/examples/_src/readme/default.erb.rb +21 -0
  25. data/examples/_src/readme/deprecated.erb.rb +21 -0
  26. data/examples/_src/readme/deprecated_alias.erb.rb +21 -0
  27. data/examples/_src/readme/description.erb.rb +60 -0
  28. data/examples/_src/readme/downcase.erb.rb +21 -0
  29. data/examples/_src/readme/enum.erb.rb +35 -0
  30. data/examples/_src/readme/example.erb.rb +25 -0
  31. data/examples/_src/readme/format.erb.rb +35 -0
  32. data/examples/_src/readme/internal.erb.rb +28 -0
  33. data/examples/_src/readme/negate.erb.rb +37 -0
  34. data/examples/_src/readme/note.erb.rb +25 -0
  35. data/examples/_src/readme/opts.erb.rb +33 -0
  36. data/examples/_src/readme/opts_block.erb.rb +30 -0
  37. data/examples/_src/readme/range.erb.rb +35 -0
  38. data/examples/_src/readme/registry.erb.rb +18 -0
  39. data/examples/_src/readme/required.erb.rb +35 -0
  40. data/examples/_src/readme/requireds.erb.rb +46 -0
  41. data/examples/_src/readme/requires.erb.rb +35 -0
  42. data/examples/_src/readme/runner.erb.rb +29 -0
  43. data/examples/_src/readme/runner_custom.erb.rb +25 -0
  44. data/examples/_src/readme/secret.erb.rb +22 -0
  45. data/examples/_src/readme/see.erb.rb +25 -0
  46. data/examples/_src/readme/type.erb.rb +21 -0
  47. data/examples/args/cast +98 -0
  48. data/examples/args/opts +98 -0
  49. data/examples/args/required +62 -0
  50. data/examples/args/splat +58 -0
  51. data/examples/gem +97 -0
  52. data/examples/heroku +48 -0
  53. data/examples/rakeish +50 -0
  54. data/examples/readme/abstract +28 -0
  55. data/examples/readme/alias +21 -0
  56. data/examples/readme/arg +20 -0
  57. data/examples/readme/arg_array +20 -0
  58. data/examples/readme/arg_type +22 -0
  59. data/examples/readme/args_splat +58 -0
  60. data/examples/readme/array +20 -0
  61. data/examples/readme/basic +67 -0
  62. data/examples/readme/default +20 -0
  63. data/examples/readme/deprecated +20 -0
  64. data/examples/readme/deprecated_alias +20 -0
  65. data/examples/readme/description +56 -0
  66. data/examples/readme/downcase +20 -0
  67. data/examples/readme/enum +33 -0
  68. data/examples/readme/example +21 -0
  69. data/examples/readme/format +33 -0
  70. data/examples/readme/internal +24 -0
  71. data/examples/readme/negate +44 -0
  72. data/examples/readme/note +21 -0
  73. data/examples/readme/opts +31 -0
  74. data/examples/readme/opts_block +29 -0
  75. data/examples/readme/range +33 -0
  76. data/examples/readme/registry +15 -0
  77. data/examples/readme/required +33 -0
  78. data/examples/readme/requireds +46 -0
  79. data/examples/readme/requires +33 -0
  80. data/examples/readme/runner +30 -0
  81. data/examples/readme/runner_custom +22 -0
  82. data/examples/readme/secret +21 -0
  83. data/examples/readme/see +21 -0
  84. data/examples/readme/type +20 -0
  85. data/lib/cl/arg.rb +79 -0
  86. data/lib/cl/args.rb +92 -0
  87. data/lib/cl/cast.rb +55 -0
  88. data/lib/cl/cmd.rb +74 -0
  89. data/lib/cl/config/env.rb +52 -0
  90. data/lib/cl/config/files.rb +34 -0
  91. data/lib/cl/config.rb +30 -0
  92. data/lib/cl/ctx.rb +36 -0
  93. data/lib/cl/dsl.rb +182 -0
  94. data/lib/cl/errors.rb +119 -0
  95. data/lib/cl/help/cmd.rb +118 -0
  96. data/lib/cl/help/cmds.rb +26 -0
  97. data/lib/cl/help/format.rb +69 -0
  98. data/lib/cl/help/table.rb +58 -0
  99. data/lib/cl/help/usage.rb +26 -0
  100. data/lib/cl/help.rb +37 -0
  101. data/lib/cl/helper/suggest.rb +10 -0
  102. data/lib/cl/helper.rb +47 -0
  103. data/lib/cl/opt.rb +276 -0
  104. data/lib/cl/opts/validate.rb +117 -0
  105. data/lib/cl/opts.rb +114 -0
  106. data/lib/cl/parser/format.rb +63 -0
  107. data/lib/cl/parser.rb +70 -0
  108. data/lib/cl/runner/default.rb +86 -0
  109. data/lib/cl/runner/multi.rb +34 -0
  110. data/lib/cl/runner.rb +10 -0
  111. data/lib/cl/ui.rb +146 -0
  112. data/lib/cl/version.rb +3 -0
  113. data/lib/cl.rb +62 -0
  114. metadata +177 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a7590687083d85ce879e649ce3e2d3dccba21fa0bd49786640324d5972469572
4
+ data.tar.gz: 94cb0d0969b4a848090037f579dc6c3322d7e058f1fa9d9d654efb2b3a4d5573
5
+ SHA512:
6
+ metadata.gz: 5f1e3871ea6ffc6eae856f1adcf2570f4781bdab3a23982395b5873f66ae6b3f3adeb481e89d878111ccd4863325ed872b14c64fc042ba54d9a3edc0a87f1a53
7
+ data.tar.gz: 6d58a845c63513fdba5826dd3663eb9289bfc2280bc33d2d044a7e99b4bab65a4e327e4f79a8e4fbbca76bed8073670c17069de03be13c018cf6efbeaf3ce398
data/CHANGELOG.md ADDED
@@ -0,0 +1,134 @@
1
+ # Changelog
2
+
3
+ ## 1.2.4 (2020-01-18)
4
+
5
+ * Make auto-registration optional, but on by default
6
+
7
+ ## 1.2.3 (2020-01-17)
8
+
9
+ * Bring back auto regisration (broke dpl)
10
+
11
+ ## 1.2.2 (2020-01-17)
12
+
13
+ * Do not auto-register commands by default
14
+
15
+ ## 1.2.1 (2020-01-14)
16
+
17
+ * Fix calling const.include on older Ruby versions
18
+
19
+ ## 1.2.0 (2020-01-14)
20
+
21
+ * Enforce declaring arguments
22
+ * Allow optional strings on long opts
23
+ * Define arg accessor on an included module so it can be overwritten
24
+ * Inherit args from parent commands
25
+ * Do not raise on empty splats
26
+ * Allow args to have defaults
27
+ * Allow args to be enums
28
+ * Define predicate methods for args
29
+ * Make flag values an optional feature
30
+ * List multiple usage lines if a command has multiple registry keys
31
+ * Sort options by class hierarchie
32
+ * Do not try to cast nil values to integers
33
+
34
+ ## 1.1.3 (2019-09-02)
35
+
36
+ * Rescue OptionParser::InvalidOption, suggest known options
37
+
38
+ ## 1.1.2 (2019-09-02)
39
+
40
+ * Fix deprecations for underscored keys
41
+
42
+ ## 1.1.1 (2019-08-26)
43
+
44
+ * Fix an issue in opt.deprecated?(name)
45
+
46
+ ## 1.1.0 (2019-08-26)
47
+
48
+ * Add suggestions on unknown cmds and enums
49
+ * Validate option options
50
+
51
+ ## 1.0.5 (2019-08-18)
52
+
53
+ ### Fixed
54
+
55
+ * Fix an issue with alias names that contain the aliased name
56
+
57
+ ## 1.0.4 (2019-08-15)
58
+
59
+ ### Fixed
60
+
61
+ * Fix enum when used with `type: :array`
62
+
63
+ ## 1.0.3 (2019-08-11)
64
+
65
+ ### Added
66
+
67
+ * Allow clients to configure Ctx so that it does not abort but raise on errors
68
+
69
+ ## 1.0.2 (2019-08-11)
70
+
71
+ ### Fixed
72
+
73
+ * Fix that validation for `opt '--one STR', requires: :other, default: 'one'` would fail if the option was not given
74
+
75
+ ## 1.0.1 (2019-08-11)
76
+
77
+ ### Added
78
+
79
+ * Add `opt '--one STR', upcase: true`
80
+
81
+ ## 1.0.0 (2019-08-10)
82
+
83
+ ### Added
84
+
85
+ * Add config, reading from env vars and yml files (inspired by gem-release)
86
+ * Add `abstract` in order to signal a cmd is a base class that is not meant to be executed
87
+ * Add `examples` in order to add examples for the command to the help output
88
+ * Add `required :one, [:two, :three]` (DNF, i.e: either `:one` or both `:two` and `:three` must be given)
89
+ * Add `opt '--one STR', type: :array` for options that can be given multiple times
90
+ * Add `opt '--one STR', default: 'one'`
91
+ * Add `opt '--one STR', requires :two` or `[:two, :three]` for options that depend on other options
92
+ * Add `opt '--one', alias: :other`
93
+ * Add `opt '--one', deprecated: 'message'`, and `cmd.deprected_opts`, so clients can look up which deprecated options were used
94
+ * Add `opt '--one', alias: :other, deprecated: :other`, so that `cmd.deprecated_opts` returns the alias name if it was used
95
+ * Add `opt '--int INT', min: 10, type: :integer`
96
+ * Add `opt '--int INT', max: 10, type: :integer`
97
+ * Add `opt '--one STR', format: /.+/`
98
+ * Add `opt '--one STR', enum: ['one', /\w+/]`
99
+ * Add `opt '--one STR', downcase: true`
100
+ * Add `opt '--one STR', internal: true`, hide internal options from help output
101
+ * Add `opt '--one STR', example: 'foo'`
102
+ * Add `opt '--one STR', negate: %w(skip)`
103
+ * Add `opt '--one STR', note: 'note'`
104
+ * Add `opt '--one STR', see: 'https://provider.com/docs'
105
+ * Add `opt '--one STR', secret: true`
106
+
107
+ ### Changed
108
+
109
+ * Much improved help output, modeled after rubygems' help output
110
+ * Cl is now a class
111
+ * Use the regstry gem, remove the local Registry implementation
112
+ * If a flag (boolean option) has a default `true` automatically add `[no-]` to it, allowing to opt out
113
+ * Runners are now registered in order to make them more easily extendable
114
+
115
+ ### Removed
116
+
117
+ * Removed cmd.defaults, options have default: [value] now
118
+
119
+ ## 0.0.4 (2017-08-02)
120
+
121
+ * Ancient history
122
+
123
+ ## 0.0.3 (2017-08-02)
124
+
125
+ * Ancient history
126
+
127
+ ## 0.0.2 (2017-04-09)
128
+
129
+ * Ancient history
130
+
131
+ ## 0.0.1 (2017-04-08)
132
+
133
+ * Ancient history
134
+
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # gem 'regstry', path: '../registry'
6
+
7
+ group :test do
8
+ gem 'memfs'
9
+ gem 'rspec'
10
+ gem 'coveralls', require: false
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ travis-cl (1.2.4)
5
+ regstry (~> 1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ bigdecimal (3.1.7)
11
+ coveralls (0.8.23)
12
+ json (>= 1.8, < 3)
13
+ simplecov (~> 0.16.1)
14
+ term-ansicolor (~> 1.3)
15
+ thor (>= 0.19.4, < 2.0)
16
+ tins (~> 1.6)
17
+ diff-lcs (1.5.1)
18
+ docile (1.4.0)
19
+ json (2.7.2)
20
+ memfs (1.0.0)
21
+ regstry (1.0.15)
22
+ rspec (3.13.0)
23
+ rspec-core (~> 3.13.0)
24
+ rspec-expectations (~> 3.13.0)
25
+ rspec-mocks (~> 3.13.0)
26
+ rspec-core (3.13.0)
27
+ rspec-support (~> 3.13.0)
28
+ rspec-expectations (3.13.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.13.0)
31
+ rspec-mocks (3.13.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.13.0)
34
+ rspec-support (3.13.1)
35
+ simplecov (0.16.1)
36
+ docile (~> 1.1)
37
+ json (>= 1.8, < 3)
38
+ simplecov-html (~> 0.10.0)
39
+ simplecov-html (0.10.2)
40
+ sync (0.5.0)
41
+ term-ansicolor (1.8.0)
42
+ tins (~> 1.0)
43
+ thor (1.3.1)
44
+ tins (1.33.0)
45
+ bigdecimal
46
+ sync
47
+
48
+ PLATFORMS
49
+ arm64-darwin-22
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ coveralls
54
+ memfs
55
+ rspec
56
+ travis-cl!
57
+
58
+ BUNDLED WITH
59
+ 2.5.9
data/MIT_LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT LICENSE
2
+
3
+ Copyright (c) 2017 Sven Fuchs <me@svenfuchs.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.