cmdlet 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.builders/data/categories.json +6 -10
- data/.builders/data/cmdlets/case.json +1 -40
- data/.builders/data/cmdlets/misc.json +30 -0
- data/.builders/generators/20-categories.rb +2 -3
- data/.builders/generators/cmdlets/case.rb +1 -0
- data/.builders/generators/cmdlets/misc.rb +22 -0
- data/CHANGELOG.md +7 -0
- data/lib/cmdlet/_.rb +1 -0
- data/lib/cmdlet/misc/safe.rb +17 -0
- data/lib/cmdlet/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27e7a1e05d48209204f34c1e04f991ed01d3d3eca2ecbe9f841826cadc177df7
|
4
|
+
data.tar.gz: 847c0632e9e33f52b014eb04bd27fcda83dea0e1837d9dcc9d7d515cc2aeb02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4501a96777d21750f4c1ea03e47305b297605e96cd6f076bfdd8af2953fa47f465ddf0a9847fb5fa87dceecd5c33cb8eee2d421a65d4b08d9047c5e07482f02
|
7
|
+
data.tar.gz: 0dfb170d52bfdbca451e2888be1e2b501a448cd0392ed0931404ce7c166c53f30f860b8fac46e57c8180c8f02958a578d86c322b1f1b2bfe160645ce8daa831b
|
@@ -1,5 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"categories": [
|
3
|
+
{
|
4
|
+
"name": "array",
|
5
|
+
"description": "Array handling routines, eg. join, join_prefix, join_post"
|
6
|
+
},
|
3
7
|
{
|
4
8
|
"name": "case",
|
5
9
|
"description": "Tokenize and apply case and/or separator"
|
@@ -13,16 +17,8 @@
|
|
13
17
|
"description": "Inflection handling routines, eg. pluralize, singular, ordinalize"
|
14
18
|
},
|
15
19
|
{
|
16
|
-
"name": "
|
17
|
-
"description": "
|
18
|
-
},
|
19
|
-
{
|
20
|
-
"name": "array",
|
21
|
-
"description": "Array handling routines, eg. join, join_prefix, join_post"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"name": "transform",
|
25
|
-
"description": "Tokenize and apply case and/or separator"
|
20
|
+
"name": "misc",
|
21
|
+
"description": "Miscellaneous cmdlets"
|
26
22
|
}
|
27
23
|
]
|
28
24
|
}
|
@@ -6,9 +6,6 @@
|
|
6
6
|
"aliases": [
|
7
7
|
"backward_slash",
|
8
8
|
"slash_backward"
|
9
|
-
],
|
10
|
-
"name_and_aliases": [
|
11
|
-
|
12
9
|
],
|
13
10
|
"description": "Convert to back slash notation",
|
14
11
|
"result": "value converted to back_slash case",
|
@@ -37,9 +34,6 @@
|
|
37
34
|
"camelUpper",
|
38
35
|
"camelU",
|
39
36
|
"pascalcase"
|
40
|
-
],
|
41
|
-
"name_and_aliases": [
|
42
|
-
|
43
37
|
],
|
44
38
|
"description": "Camel case the characters in the given 'string'",
|
45
39
|
"result": "value converted to camel case",
|
@@ -65,9 +59,6 @@
|
|
65
59
|
"name": "constant",
|
66
60
|
"aliases": [
|
67
61
|
"constantize"
|
68
|
-
],
|
69
|
-
"name_and_aliases": [
|
70
|
-
|
71
62
|
],
|
72
63
|
"description": "Constant case the characters in the given 'string'",
|
73
64
|
"result": "value converted to constant case",
|
@@ -96,9 +87,6 @@
|
|
96
87
|
"dashify",
|
97
88
|
"dashcase",
|
98
89
|
"hyphenate"
|
99
|
-
],
|
100
|
-
"name_and_aliases": [
|
101
|
-
|
102
90
|
],
|
103
91
|
"description": "Dash case the characters in the given 'string'",
|
104
92
|
"result": "value converted to dash case",
|
@@ -127,9 +115,6 @@
|
|
127
115
|
"dotify",
|
128
116
|
"dotcase",
|
129
117
|
"hyphenate"
|
130
|
-
],
|
131
|
-
"name_and_aliases": [
|
132
|
-
|
133
118
|
],
|
134
119
|
"description": "Dot case the characters in the given 'string'",
|
135
120
|
"result": "value converted to dot case",
|
@@ -155,9 +140,6 @@
|
|
155
140
|
"name": "double_colon",
|
156
141
|
"aliases": [
|
157
142
|
|
158
|
-
],
|
159
|
-
"name_and_aliases": [
|
160
|
-
|
161
143
|
],
|
162
144
|
"description": "Double colon case the characters in the given 'string'",
|
163
145
|
"result": "value converted to double_colon case",
|
@@ -184,9 +166,6 @@
|
|
184
166
|
"aliases": [
|
185
167
|
"humanize",
|
186
168
|
"sentence"
|
187
|
-
],
|
188
|
-
"name_and_aliases": [
|
189
|
-
|
190
169
|
],
|
191
170
|
"description": "Human case the characters in the given 'string'",
|
192
171
|
"result": "value converted to human case",
|
@@ -214,9 +193,6 @@
|
|
214
193
|
"camel_lower",
|
215
194
|
"camelLower",
|
216
195
|
"camelL"
|
217
|
-
],
|
218
|
-
"name_and_aliases": [
|
219
|
-
|
220
196
|
],
|
221
197
|
"description": "Lower camel case the characters in the given 'string'",
|
222
198
|
"result": "value converted to lower camel case",
|
@@ -243,9 +219,6 @@
|
|
243
219
|
"aliases": [
|
244
220
|
"lowercase",
|
245
221
|
"downcase"
|
246
|
-
],
|
247
|
-
"name_and_aliases": [
|
248
|
-
|
249
222
|
],
|
250
223
|
"description": "Lower case the characters in the given 'string'",
|
251
224
|
"result": "value converted to lower case",
|
@@ -272,9 +245,6 @@
|
|
272
245
|
"aliases": [
|
273
246
|
"forward_slash",
|
274
247
|
"slash_forward"
|
275
|
-
],
|
276
|
-
"name_and_aliases": [
|
277
|
-
|
278
248
|
],
|
279
249
|
"description": "Slash case the characters in the given 'string'",
|
280
250
|
"result": "value converted to slash case",
|
@@ -300,9 +270,6 @@
|
|
300
270
|
"name": "snake",
|
301
271
|
"aliases": [
|
302
272
|
|
303
|
-
],
|
304
|
-
"name_and_aliases": [
|
305
|
-
|
306
273
|
],
|
307
274
|
"description": "Snake case the characters in the given 'string'",
|
308
275
|
"result": "value converted to snake case",
|
@@ -327,10 +294,7 @@
|
|
327
294
|
{
|
328
295
|
"name": "title",
|
329
296
|
"aliases": [
|
330
|
-
|
331
|
-
],
|
332
|
-
"name_and_aliases": [
|
333
|
-
|
297
|
+
"titleize"
|
334
298
|
],
|
335
299
|
"description": "Title case the characters in the given 'string'",
|
336
300
|
"result": "value converted to title case",
|
@@ -357,9 +321,6 @@
|
|
357
321
|
"aliases": [
|
358
322
|
"upcase",
|
359
323
|
"uppercase"
|
360
|
-
],
|
361
|
-
"name_and_aliases": [
|
362
|
-
|
363
324
|
],
|
364
325
|
"description": "Upper case the characters in the given 'string'",
|
365
326
|
"result": "value converted to upper case",
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"category_key": "misc",
|
3
|
+
"cmdlets": [
|
4
|
+
{
|
5
|
+
"name": "safe",
|
6
|
+
"aliases": [
|
7
|
+
|
8
|
+
],
|
9
|
+
"description": "pass through the value with <> and single and double quotes left as is",
|
10
|
+
"result": "the value with <> and single and double quotes left as is",
|
11
|
+
"category": "misc",
|
12
|
+
"category_description": "Miscellaneous cmdlets",
|
13
|
+
"base_class_require": null,
|
14
|
+
"base_class": null,
|
15
|
+
"parameters": [
|
16
|
+
{
|
17
|
+
"name": "values",
|
18
|
+
"description": "valure to pass throught",
|
19
|
+
"splat": null,
|
20
|
+
"default": null,
|
21
|
+
"param_type": "String|Int"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"examples": [
|
25
|
+
|
26
|
+
],
|
27
|
+
"ruby": " value = '' if value.nil?\n value\n"
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
@@ -4,12 +4,11 @@ KManager.action :categories do
|
|
4
4
|
action do
|
5
5
|
CategoryDirector
|
6
6
|
.init(k_builder)
|
7
|
+
.category(:array , 'Array handling routines, eg. join, join_prefix, join_post')
|
7
8
|
.category(:case , 'Tokenize and apply case and/or separator')
|
8
9
|
.category(:comparison , 'Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc.')
|
9
10
|
.category(:inflection , 'Inflection handling routines, eg. pluralize, singular, ordinalize')
|
10
|
-
.category(:
|
11
|
-
.category(:array , 'Array handling routines, eg. join, join_prefix, join_post')
|
12
|
-
.category(:transform , 'Tokenize and apply case and/or separator')
|
11
|
+
.category(:misc , 'Miscellaneous cmdlets')
|
13
12
|
.save_categories
|
14
13
|
.generate
|
15
14
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
KManager.action :misc_commands do
|
4
|
+
action do
|
5
|
+
CmdletDirector
|
6
|
+
.init(k_builder, category: :misc)
|
7
|
+
.cmdlet do
|
8
|
+
name :safe
|
9
|
+
description 'pass through the value with <> and single and double quotes left as is'
|
10
|
+
result 'the value with <> and single and double quotes left as is'
|
11
|
+
|
12
|
+
parameter :values, 'valure to pass throught', param_type: 'String|Int'
|
13
|
+
|
14
|
+
ruby <<-RUBY
|
15
|
+
value = '' if value.nil?
|
16
|
+
value
|
17
|
+
RUBY
|
18
|
+
end
|
19
|
+
.generate
|
20
|
+
# .debug
|
21
|
+
end
|
22
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.7.1](https://github.com/klueless-io/cmdlet/compare/v0.7.0...v0.7.1) (2022-07-15)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add alias support ([c26a092](https://github.com/klueless-io/cmdlet/commit/c26a092d2c5fdf49ae6b1ebb017f4a6e4399a499))
|
7
|
+
|
1
8
|
# [0.7.0](https://github.com/klueless-io/cmdlet/compare/v0.6.2...v0.7.0) (2022-07-14)
|
2
9
|
|
3
10
|
|
data/lib/cmdlet/_.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cmdlet
|
4
|
+
# Miscellaneous cmdlets
|
5
|
+
module Misc
|
6
|
+
# Safe: pass through the value with <> and single and double quotes left as is
|
7
|
+
class Safe < Cmdlet::BaseCmdlet
|
8
|
+
#
|
9
|
+
# @param [String|Int] values - valure to pass throught
|
10
|
+
# @return [String] the value with <> and single and double quotes left as is
|
11
|
+
def call(_values)
|
12
|
+
value = '' if value.nil?
|
13
|
+
value
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/cmdlet/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "cmdlet",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.0",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "cmdlet",
|
9
|
-
"version": "0.
|
9
|
+
"version": "0.8.0",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmdlet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- ".builders/data/cmdlets/case.json"
|
62
62
|
- ".builders/data/cmdlets/comparison.json"
|
63
63
|
- ".builders/data/cmdlets/inflection.json"
|
64
|
+
- ".builders/data/cmdlets/misc.json"
|
64
65
|
- ".builders/director/category_builder.rb"
|
65
66
|
- ".builders/director/category_dao.rb"
|
66
67
|
- ".builders/director/category_director.rb"
|
@@ -77,6 +78,7 @@ files:
|
|
77
78
|
- ".builders/generators/cmdlets/case.rb"
|
78
79
|
- ".builders/generators/cmdlets/comparison.rb"
|
79
80
|
- ".builders/generators/cmdlets/inflection.rb"
|
81
|
+
- ".builders/generators/cmdlets/misc.rb"
|
80
82
|
- ".releaserc.json"
|
81
83
|
- ".rspec"
|
82
84
|
- ".rubocop.yml"
|
@@ -125,6 +127,7 @@ files:
|
|
125
127
|
- lib/cmdlet/inflection/pluralize_number.rb
|
126
128
|
- lib/cmdlet/inflection/pluralize_number_word.rb
|
127
129
|
- lib/cmdlet/inflection/singularize.rb
|
130
|
+
- lib/cmdlet/misc/safe.rb
|
128
131
|
- lib/cmdlet/string_tokenizer.rb
|
129
132
|
- lib/cmdlet/version.rb
|
130
133
|
- package-lock.json
|