cmdlet 0.6.1 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5faa2f1cc957beed6274a4da073eae8f3c8dd9b937a99f2edb1fee7adcefe36
4
- data.tar.gz: 9baead36a85c44b8427f5cbf14164f18adf13dbaf2a05d6cacc7cbdd444e8ab2
3
+ metadata.gz: cf0c83571b75ce678c2e41fd2fb10f4aa93d11d9f622d063c82c4b85a91225d2
4
+ data.tar.gz: cc75a76bd073ef9b31e9a951902cb8b47d95659555e4005bdbdb3b9d8a956fb1
5
5
  SHA512:
6
- metadata.gz: 5bd1875dcf63c87dfd8f7b589083a8b6919857cbae800934872637fb949143181851ae026683f20245927ec84a012b3fb6bf7647bde66f742f5ed6fbbcf9de3b
7
- data.tar.gz: b856cca6babb797456e7411ae43b21c47580460d514a3d4d8d3e7f22e5ba886644c83b599bda5ee60dc1d6e65dbc96aadf38c09722786c86a30fa7505b86733d
6
+ metadata.gz: 6bbcd91e955a7c87c225185f2da007059a52246c13af9cf8e3d785c39eed90668c7678670b4fd36bca8485a28f896164b252a3694aba664918a661d74bb3814a
7
+ data.tar.gz: 000cc2a1bddadce50ffa57c792b44991fc67c43a01f3a4500f5e8563d1f8fc8bac51a8a6f59d8eb8c150b8d22006e86e8b72d34fbf9133810d5f51a834fe597d
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Handlebarsjs
4
+ # Pre-configure default helpers for each category
5
+ class HandlebarsConfigurationDefaults
6
+ def add_all_defaults
7
+ {{#each cmdlet_categories}}
8
+ add_{{category}}_defaults
9
+ {{/each}}
10
+ end
11
+
12
+ {{#each cmdlet_categories}}
13
+ def add_{{category}}_defaults
14
+ KConfig.configure do |config|
15
+ {{#each cmdlets}}
16
+ config.handlebars.helper(:{{name}}, Handlebarsjs::Helpers::{{camel category}}::{{camel name}}.new{{#if aliases}}, aliases: %i[{{#each aliases}}{{#if @first}}{{^}} {{/if}}{{.}}{{/each}}]{{/if}})
17
+ {{/each}}
18
+ end
19
+ end
20
+
21
+ {{/each}}
22
+ end
23
+ end
@@ -3,6 +3,12 @@
3
3
  "cmdlets": [
4
4
  {
5
5
  "name": "join",
6
+ "aliases": [
7
+
8
+ ],
9
+ "name_and_aliases": [
10
+
11
+ ],
6
12
  "description": "join an array of values with separator as a string",
7
13
  "result": "new String formed by joining the array elements with seperator",
8
14
  "category": "array",
@@ -32,6 +38,12 @@
32
38
  },
33
39
  {
34
40
  "name": "join_pre",
41
+ "aliases": [
42
+
43
+ ],
44
+ "name_and_aliases": [
45
+
46
+ ],
35
47
  "description": "join an array of values with separator as a string and using the separator at the beginning of string",
36
48
  "result": null,
37
49
  "category": "array",
@@ -61,6 +73,12 @@
61
73
  },
62
74
  {
63
75
  "name": "join_post",
76
+ "aliases": [
77
+
78
+ ],
79
+ "name_and_aliases": [
80
+
81
+ ],
64
82
  "description": "join an array of values with separator as a string and using the separator at the end of string",
65
83
  "result": null,
66
84
  "category": "array",
@@ -3,6 +3,13 @@
3
3
  "cmdlets": [
4
4
  {
5
5
  "name": "back_slash",
6
+ "aliases": [
7
+ "backward_slash",
8
+ "slash_backward"
9
+ ],
10
+ "name_and_aliases": [
11
+
12
+ ],
6
13
  "description": "Convert to back slash notation",
7
14
  "result": "value converted to back_slash case",
8
15
  "category": "case",
@@ -25,6 +32,15 @@
25
32
  },
26
33
  {
27
34
  "name": "camel",
35
+ "aliases": [
36
+ "camel_upper",
37
+ "camelUpper",
38
+ "camelU",
39
+ "pascalcase"
40
+ ],
41
+ "name_and_aliases": [
42
+
43
+ ],
28
44
  "description": "Camel case the characters in the given 'string'",
29
45
  "result": "value converted to camel case",
30
46
  "category": "case",
@@ -47,6 +63,12 @@
47
63
  },
48
64
  {
49
65
  "name": "constant",
66
+ "aliases": [
67
+ "constantize"
68
+ ],
69
+ "name_and_aliases": [
70
+
71
+ ],
50
72
  "description": "Constant case the characters in the given 'string'",
51
73
  "result": "value converted to constant case",
52
74
  "category": "case",
@@ -69,6 +91,15 @@
69
91
  },
70
92
  {
71
93
  "name": "dash",
94
+ "aliases": [
95
+ "dasherize",
96
+ "dashify",
97
+ "dashcase",
98
+ "hyphenate"
99
+ ],
100
+ "name_and_aliases": [
101
+
102
+ ],
72
103
  "description": "Dash case the characters in the given 'string'",
73
104
  "result": "value converted to dash case",
74
105
  "category": "case",
@@ -91,6 +122,15 @@
91
122
  },
92
123
  {
93
124
  "name": "dot",
125
+ "aliases": [
126
+ "dotirize",
127
+ "dotify",
128
+ "dotcase",
129
+ "hyphenate"
130
+ ],
131
+ "name_and_aliases": [
132
+
133
+ ],
94
134
  "description": "Dot case the characters in the given 'string'",
95
135
  "result": "value converted to dot case",
96
136
  "category": "case",
@@ -113,6 +153,12 @@
113
153
  },
114
154
  {
115
155
  "name": "double_colon",
156
+ "aliases": [
157
+
158
+ ],
159
+ "name_and_aliases": [
160
+
161
+ ],
116
162
  "description": "Double colon case the characters in the given 'string'",
117
163
  "result": "value converted to double_colon case",
118
164
  "category": "case",
@@ -135,6 +181,13 @@
135
181
  },
136
182
  {
137
183
  "name": "human",
184
+ "aliases": [
185
+ "humanize",
186
+ "sentence"
187
+ ],
188
+ "name_and_aliases": [
189
+
190
+ ],
138
191
  "description": "Human case the characters in the given 'string'",
139
192
  "result": "value converted to human case",
140
193
  "category": "case",
@@ -157,6 +210,14 @@
157
210
  },
158
211
  {
159
212
  "name": "lamel",
213
+ "aliases": [
214
+ "camel_lower",
215
+ "camelLower",
216
+ "camelL"
217
+ ],
218
+ "name_and_aliases": [
219
+
220
+ ],
160
221
  "description": "Lower camel case the characters in the given 'string'",
161
222
  "result": "value converted to lower camel case",
162
223
  "category": "case",
@@ -179,6 +240,13 @@
179
240
  },
180
241
  {
181
242
  "name": "lower",
243
+ "aliases": [
244
+ "lowercase",
245
+ "downcase"
246
+ ],
247
+ "name_and_aliases": [
248
+
249
+ ],
182
250
  "description": "Lower case the characters in the given 'string'",
183
251
  "result": "value converted to lower case",
184
252
  "category": "case",
@@ -201,6 +269,13 @@
201
269
  },
202
270
  {
203
271
  "name": "slash",
272
+ "aliases": [
273
+ "forward_slash",
274
+ "slash_forward"
275
+ ],
276
+ "name_and_aliases": [
277
+
278
+ ],
204
279
  "description": "Slash case the characters in the given 'string'",
205
280
  "result": "value converted to slash case",
206
281
  "category": "case",
@@ -223,6 +298,12 @@
223
298
  },
224
299
  {
225
300
  "name": "snake",
301
+ "aliases": [
302
+
303
+ ],
304
+ "name_and_aliases": [
305
+
306
+ ],
226
307
  "description": "Snake case the characters in the given 'string'",
227
308
  "result": "value converted to snake case",
228
309
  "category": "case",
@@ -245,6 +326,12 @@
245
326
  },
246
327
  {
247
328
  "name": "title",
329
+ "aliases": [
330
+
331
+ ],
332
+ "name_and_aliases": [
333
+
334
+ ],
248
335
  "description": "Title case the characters in the given 'string'",
249
336
  "result": "value converted to title case",
250
337
  "category": "case",
@@ -267,6 +354,13 @@
267
354
  },
268
355
  {
269
356
  "name": "upper",
357
+ "aliases": [
358
+ "upcase",
359
+ "uppercase"
360
+ ],
361
+ "name_and_aliases": [
362
+
363
+ ],
270
364
  "description": "Upper case the characters in the given 'string'",
271
365
  "result": "value converted to upper case",
272
366
  "category": "case",
@@ -11,6 +11,7 @@ class CategoryDirector < KDirector::Directors::BaseDirector
11
11
 
12
12
  def generate
13
13
  generate_require_all_cmdlets
14
+ run_cop
14
15
 
15
16
  self
16
17
  end
@@ -39,6 +40,22 @@ class CategoryDirector < KDirector::Directors::BaseDirector
39
40
  template_file: 'handlebars_helper_require_all.rb',
40
41
  cmdlets: data_access.cmdlet.all_cmdlets)
41
42
 
43
+ add('handlebarsjs/handlebars_configuration_defaults.rb',
44
+ template_file: 'handlebars_helper_configuration_defaults.rb',
45
+ cmdlet_categories: data_access.cmdlet.all_cmdlets_by_category)
42
46
  end
43
-
47
+
48
+ def run_cop
49
+ Dir.chdir(k_builder.target_folders.get(:lib)) do
50
+ k_builder.run_cop('**/*.rb', fix_unsafe: true)
51
+ end
52
+
53
+ Dir.chdir(k_builder.target_folders.get(:handlebars_lib)) do
54
+ k_builder.run_cop('**/*.rb', fix_unsafe: true)
55
+ end
56
+
57
+ self
58
+ end
59
+
60
+
44
61
  end
@@ -54,6 +54,7 @@ class CmdletBuilder < KDirector::Builders::ActionsBuilder
54
54
 
55
55
  {
56
56
  name: nil,
57
+ aliases: [],
57
58
  description: nil,
58
59
  result: nil,
59
60
  category: category[:name],
@@ -11,6 +11,10 @@ class CmdletChild < KDirector::Directors::ChildDirector
11
11
  builder.cmdlet_setting(:name, value)
12
12
  end
13
13
 
14
+ def aliases(value)
15
+ builder.cmdlet_setting(:aliases, value)
16
+ end
17
+
14
18
  def description(value)
15
19
  builder.cmdlet_setting(:description, value)
16
20
  end
@@ -16,6 +16,11 @@ class CmdletDao
16
16
  .sort_by { |r| [r[:category], r[:name]] }
17
17
  end
18
18
 
19
+ def all_cmdlets_by_category
20
+ grouped_categories = all_cmdlets.group_by { |cmdlet| cmdlet[:category] }
21
+ grouped_categories.keys.map { |category_key| { category: category_key, cmdlets: grouped_categories[category_key] } }
22
+ end
23
+
19
24
  private
20
25
 
21
26
  def read_cmdlets(category_name)
@@ -48,16 +48,6 @@ class CmdletDirector < KDirector::Directors::BaseDirector
48
48
  add(handlebars_spec_file, template_file: 'handlebars_helper_spec.rb', cmdlet: cmdlet, on_exist: :skip)
49
49
  end
50
50
 
51
- if builder.cmdlets.length.positive?
52
- cd(:handlebars_lib)
53
-
54
- category = builder.cmdlets.first[:category]
55
- handlebars_category_configuration_file = "handlebarsjs/helpers/#{category}/default_configuration.rb"
56
-
57
- add(handlebars_category_configuration_file, template_file: 'handlebars_helper_default_configuration.rb', cmdlets: builder.cmdlets)
58
- end
59
-
60
-
61
51
  self
62
52
  end
63
53
 
@@ -51,6 +51,6 @@ KManager.action :array_commands do
51
51
  RUBY
52
52
  end
53
53
  .generate
54
- .debug
54
+ # .debug
55
55
  end
56
56
  end
@@ -6,6 +6,7 @@ KManager.action :case_commands do
6
6
  .init(k_builder, category: :case)
7
7
  .cmdlet do
8
8
  name :back_slash
9
+ aliases %i[backward_slash slash_backward]
9
10
  description 'Convert to back slash notation'
10
11
  result 'value converted to back_slash case'
11
12
 
@@ -17,6 +18,7 @@ KManager.action :case_commands do
17
18
  end
18
19
  .cmdlet do
19
20
  name :camel
21
+ aliases %i[camel_upper camelUpper camelU pascalcase]
20
22
  description "Camel case the characters in the given 'string'"
21
23
  result 'value converted to camel case'
22
24
 
@@ -28,6 +30,7 @@ KManager.action :case_commands do
28
30
  end
29
31
  .cmdlet do
30
32
  name :constant
33
+ aliases %i[constantize]
31
34
  description "Constant case the characters in the given 'string'"
32
35
  result 'value converted to constant case'
33
36
 
@@ -39,6 +42,7 @@ KManager.action :case_commands do
39
42
  end
40
43
  .cmdlet do
41
44
  name :dash
45
+ aliases %i[dasherize dashify dashcase hyphenate]
42
46
  description "Dash case the characters in the given 'string'"
43
47
  result 'value converted to dash case'
44
48
 
@@ -50,6 +54,7 @@ KManager.action :case_commands do
50
54
  end
51
55
  .cmdlet do
52
56
  name :dot
57
+ aliases %i[dotirize dotify dotcase hyphenate]
53
58
  description "Dot case the characters in the given 'string'"
54
59
  result 'value converted to dot case'
55
60
 
@@ -72,6 +77,7 @@ KManager.action :case_commands do
72
77
  end
73
78
  .cmdlet do
74
79
  name :human
80
+ aliases %i[humanize sentence]
75
81
  description "Human case the characters in the given 'string'"
76
82
  result 'value converted to human case'
77
83
 
@@ -87,6 +93,7 @@ KManager.action :case_commands do
87
93
  end
88
94
  .cmdlet do
89
95
  name :lamel
96
+ aliases %i[camel_lower camelLower camelL]
90
97
  description "Lower camel case the characters in the given 'string'"
91
98
  result 'value converted to lower camel case'
92
99
 
@@ -98,6 +105,7 @@ KManager.action :case_commands do
98
105
  end
99
106
  .cmdlet do
100
107
  name :lower
108
+ aliases %i[lowercase downcase]
101
109
  description "Lower case the characters in the given 'string'"
102
110
  result 'value converted to lower case'
103
111
 
@@ -111,6 +119,7 @@ KManager.action :case_commands do
111
119
  end
112
120
  .cmdlet do
113
121
  name :slash
122
+ aliases %i[forward_slash slash_forward]
114
123
  description "Slash case the characters in the given 'string'"
115
124
  result 'value converted to slash case'
116
125
 
@@ -149,6 +158,7 @@ KManager.action :case_commands do
149
158
  end
150
159
  .cmdlet do
151
160
  name :upper
161
+ aliases %i[upcase uppercase]
152
162
  description "Upper case the characters in the given 'string'"
153
163
  result 'value converted to upper case'
154
164
 
@@ -6,6 +6,7 @@ KManager.action :comparison_commands do
6
6
  .init(k_builder, category: :comparison)
7
7
  .cmdlet do
8
8
  name :and
9
+ aliases %i[all]
9
10
  description 'Return true if **all of** the given values are truthy.'
10
11
  result 'return true when every value is truthy'
11
12
 
@@ -33,6 +34,7 @@ KManager.action :comparison_commands do
33
34
  end
34
35
  .cmdlet do
35
36
  name :eq
37
+ aliases %i[equal]
36
38
  description 'Return true if two values are equal'
37
39
  result 'return truthy value if left hand side equals right hand side'
38
40
 
@@ -48,6 +50,7 @@ KManager.action :comparison_commands do
48
50
  end
49
51
  .cmdlet do
50
52
  name :gt
53
+ aliases %i[greater_than]
51
54
  description 'Return true if left hand side GREATER THAN right hand side'
52
55
  result 'truthy value if left hand side GREATER THAN right hand side'
53
56
 
@@ -60,6 +63,7 @@ KManager.action :comparison_commands do
60
63
  end
61
64
  .cmdlet do
62
65
  name :gte
66
+ aliases %i[greater_than_or_equal_to]
63
67
  description 'Return true if left hand side GREATER THAN or EQUAL TO right hand side'
64
68
  result 'truthy value if left hand side GREATER THAN or EQUAL TO right hand side'
65
69
 
@@ -72,6 +76,7 @@ KManager.action :comparison_commands do
72
76
  end
73
77
  .cmdlet do
74
78
  name :lt
79
+ aliases %i[less_than]
75
80
  description 'Return true if left hand side LESS THAN right hand side'
76
81
  result 'truthy value if left hand side LESS THAN right hand side'
77
82
 
@@ -84,6 +89,7 @@ KManager.action :comparison_commands do
84
89
  end
85
90
  .cmdlet do
86
91
  name :lte
92
+ aliases %i[less_than_or_equal_to]
87
93
  description 'Return true if left hand side LESS THAN or EQUAL TO right hand side'
88
94
  result 'truthy value if left hand side LESS THAN or EQUAL TO right hand side'
89
95
 
@@ -96,6 +102,7 @@ KManager.action :comparison_commands do
96
102
  end
97
103
  .cmdlet do
98
104
  name :ne
105
+ aliases %i[not_equal]
99
106
  description 'Return true if left hand side is NOT equal to right hand side'
100
107
  result 'truthy value if left hand side is NOT equal to right hand side'
101
108
 
@@ -111,6 +118,7 @@ KManager.action :comparison_commands do
111
118
  end
112
119
  .cmdlet do
113
120
  name :or
121
+ aliases %i[any]
114
122
  description 'Return true if any value is truthy.'
115
123
  result 'return true when first value is truthy'
116
124
 
@@ -36,6 +36,7 @@ KManager.action :inflection_commands do
36
36
  end
37
37
  .cmdlet do
38
38
  name :pluralize
39
+ aliases %i[plural]
39
40
  description 'Returns the plural form of the word in the string'
40
41
  result 'value in plural form'
41
42
 
@@ -83,6 +84,7 @@ KManager.action :inflection_commands do
83
84
  end
84
85
  .cmdlet do
85
86
  name :singularize
87
+ aliases %i[singular]
86
88
  description 'The reverse of #pluralize, returns the singular form of a word in a string'
87
89
  result 'plural value turned to singular value'
88
90
 
data/.rubocop.yml CHANGED
@@ -41,7 +41,7 @@ Metrics/MethodLength:
41
41
  Layout/LineLength:
42
42
  Max: 200
43
43
  # Ignores annotate output
44
- # IgnoredPatterns: ['\A# \*\*'] # this is renamed to AllowedPatterns and I need to come up with a template for this
44
+ AllowedPatterns: ['\A# \*\*'] # this is renamed to AllowedPatterns and I need to come up with a template for this
45
45
  IgnoreCopDirectives: true
46
46
 
47
47
  Lint/UnusedMethodArgument:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # [0.7.0](https://github.com/klueless-io/cmdlet/compare/v0.6.2...v0.7.0) (2022-07-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * bump activesupport gem version ([4833f48](https://github.com/klueless-io/cmdlet/commit/4833f484411a3c308b1682489c591f45d88bee88))
7
+
8
+ ## [0.6.2](https://github.com/klueless-io/cmdlet/compare/v0.6.1...v0.6.2) (2022-07-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove alias :parse, :call ([375deb4](https://github.com/klueless-io/cmdlet/commit/375deb4a69f40e56265abaed9b52dd552e7235ef))
14
+
15
+ ## [0.6.1](https://github.com/klueless-io/cmdlet/compare/v0.6.0...v0.6.1) (2022-07-13)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add alias :parse, :call ([328e0e5](https://github.com/klueless-io/cmdlet/commit/328e0e56050277fcee5c4e867f628afaf21f0d25))
21
+ * add alias :parse, :call ([ea54e24](https://github.com/klueless-io/cmdlet/commit/ea54e2444f3b22d4c790c0aba9dc82c232527bcc))
22
+
1
23
  # [0.6.0](https://github.com/klueless-io/cmdlet/compare/v0.5.0...v0.6.0) (2022-07-13)
2
24
 
3
25
 
@@ -6,7 +6,6 @@ module Cmdlet
6
6
  def call(value)
7
7
  value
8
8
  end
9
- alias parse call
10
9
 
11
10
  # String tokenizer will clean up a string so that
12
11
  # all sorts of case formatted strings can be
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cmdlet
4
- VERSION = '0.6.1'
4
+ VERSION = '0.7.1'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "cmdlet",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "cmdlet",
9
- "version": "0.6.1",
9
+ "version": "0.7.1",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmdlet",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Cmdlet provides a set of functions (wrapped in the command pattern) that perform simple actions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmdlet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-13 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6'
19
+ version: '7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6'
26
+ version: '7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: k_config
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ files:
51
51
  - ".builders/.templates/cmdlet_spec.rb"
52
52
  - ".builders/.templates/cmdlets_require_all.rb"
53
53
  - ".builders/.templates/handlebars_helper.rb"
54
- - ".builders/.templates/handlebars_helper_default_configuration.rb"
54
+ - ".builders/.templates/handlebars_helper_configuration_defaults.rb"
55
55
  - ".builders/.templates/handlebars_helper_require_all.rb"
56
56
  - ".builders/.templates/handlebars_helper_spec.rb"
57
57
  - ".builders/_.rb"
@@ -73,7 +73,6 @@ files:
73
73
  - ".builders/documents/x_functions.rb"
74
74
  - ".builders/generators/01-bootstrap.rb"
75
75
  - ".builders/generators/20-categories.rb"
76
- - ".builders/generators/30-commands-bak.rb"
77
76
  - ".builders/generators/cmdlets/array.rb"
78
77
  - ".builders/generators/cmdlets/case.rb"
79
78
  - ".builders/generators/cmdlets/comparison.rb"
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KConfig.configure do |config|
4
- {{#each cmdlets}}
5
- config.handlebars.helper(:{{name}}, Handlebarsjs::Helpers::{{camel category}}::{{camel name}}.new)
6
- {{/each}}
7
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KManager.action :commands_bak do
4
- action do
5
- puts commands.first.function_description
6
- # Ruby Gem Bootstrap
7
- director = KDirector::Dsls::BasicDsl
8
- .init(k_builder,
9
- template_base_folder: '',
10
- on_exist: :skip, # %i[skip write compare]
11
- on_action: :queue # %i[queue execute]
12
- )
13
- .blueprint(
14
- active: true,
15
- name: :build_commands,
16
- description: 'Build Commandlets',
17
- on_exist: :write
18
- ) do
19
- cd(:lib)
20
-
21
- # builder
22
- # .add_file('FUNCTIONS.md',
23
- # template_file: 'FUNCTIONS.md',
24
- # categories: categories.sort_by { |r| r.name },
25
- # functions: functions.sort_by { |r| [r.category, r.name] },
26
- # on_exist: :write)
27
-
28
- add('all_commands.rb',
29
- template_file: 'all_commands.rb',
30
- commands: commands.sort_by { |r| [r.category, r.name] },
31
- on_exist: :write)
32
-
33
- cmdlets.each do |cmdlet|
34
- add("#{cmdlet.category}/#{cmdlet.name}.rb",
35
- cmdlet: cmdlet,
36
- template_file: 'command.rb',
37
- on_exist: :write)
38
- end
39
- end
40
-
41
- director.play_actions
42
- # director.builder.logit
43
- end
44
- end
45
-
46
- KManager.opts.app_name = 'commands'
47
- KManager.opts.sleep = 2
48
- KManager.opts.reboot_on_kill = 0
49
- KManager.opts.reboot_sleep = 4
50
- KManager.opts.exception_style = :short
51
- KManager.opts.show.time_taken = true
52
- KManager.opts.show.finished = true
53
- KManager.opts.show.finished_message = 'FINISHED :)'