cmdlet 0.5.0 → 0.6.2

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: 7858e7b563b7d8fd9ed449d7d21de54eb3f6816d28fb80b7b46deb2fb741101f
4
- data.tar.gz: 92fddb23254d18ab8ae07bfe00c3d593845aadd1243e2e1bfee78b7c4628da4b
3
+ metadata.gz: a1c1bfda595186dd7d420cb572e06a083d1bf23a248b083fba934409ad8a64f7
4
+ data.tar.gz: bf10b589b5c54f5d8f17ad7bb2c300bc9121b297fbd9062a1d5b45c603dd70c5
5
5
  SHA512:
6
- metadata.gz: 40f58c5d81364fb22291245f52b5b6e457f123f36a88a380e74e9dd7102d42f2afd63888165570849a4502dd25a90fd37bca056decaa3edd4de0f3747d9500e9
7
- data.tar.gz: c3058b29c7f59a80c2bc58f237a05fa8a690b5d7444a04afcd8451919476d0dc0c00c599425502971b9e2b55c6166b51cef3049d6aca903700329b66997cff38
6
+ metadata.gz: 244567fc0d012c709c35eb708a70cca2f717961108e924b4ca8094fd96dae215c1418af20a9e6bfae0cff5af8d6d45e89b6d3e693549051752c1abed7be34a42
7
+ data.tar.gz: c47a22184413e5cbc3515ac78aac4d39c9c3b5516b3c78dc164528e27a2b75a49a386cd7ae2fddd923531eec9afd21cf75774eef3560a9f630a00d31b8b4b638
@@ -0,0 +1,7 @@
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
data/.builders/boot.rb CHANGED
@@ -8,34 +8,11 @@ CONFIG_KEY = :cmdlet
8
8
 
9
9
  log.kv 'working folder', Dir.pwd
10
10
 
11
- Handlebars::Helpers.configure do |config|
12
- config.helper_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_helpers.json')
13
- config.string_formatter_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_string_formatters.json')
14
- end
15
-
16
- def camel
17
- require 'handlebars/helpers/string_formatting/camel'
18
- Handlebars::Helpers::StringFormatting::Camel.new
19
- end
20
-
21
- def titleize
22
- require 'handlebars/helpers/string_formatting/titleize'
23
- Handlebars::Helpers::StringFormatting::Titleize.new
24
- end
25
-
26
- def pluralize
27
- require 'handlebars/helpers/inflection/pluralize'
28
- Handlebars::Helpers::Inflection::Pluralize.new
29
- end
30
-
31
- def singularize
32
- require 'handlebars/helpers/inflection/singularize'
33
- Handlebars::Helpers::Inflection::Singularize.new
34
- end
35
-
36
- def dasherize
37
- require 'handlebars/helpers/string_formatting/dasherize'
38
- Handlebars::Helpers::StringFormatting::Dasherize.new
11
+ KConfig.configure do |config|
12
+ config.handlebars.defaults.add_array_defaults
13
+ config.handlebars.defaults.add_case_defaults
14
+ config.handlebars.defaults.add_comparison_defaults
15
+ config.handlebars.defaults.add_inflection_defaults
39
16
  end
40
17
 
41
18
  def k_builder
@@ -59,35 +59,6 @@
59
59
  ],
60
60
  "ruby": " return '' if values.nil? || !values.is_a?(::Array)\n values = values.reject(&:blank?)\n return '' if values.length.zero?\n\n \"#{separator}#{values.join(separator)}\"\n"
61
61
  },
62
- {
63
- "name": "join_pre",
64
- "description": "join an array of values with separator as a string and using the separator at the beginning of string",
65
- "result": null,
66
- "category": "array",
67
- "category_description": "Array handling routines, eg. join, join_prefix, join_post",
68
- "base_class_require": null,
69
- "base_class": null,
70
- "parameters": [
71
- {
72
- "name": "values",
73
- "description": "array of values to join",
74
- "splat": null,
75
- "default": null,
76
- "param_type": "String|Int"
77
- },
78
- {
79
- "name": "separator",
80
- "description": "separator between values, defaults to comma",
81
- "splat": null,
82
- "default": "','",
83
- "param_type": "String"
84
- }
85
- ],
86
- "examples": [
87
-
88
- ],
89
- "ruby": " return '' if values.nil? || !values.is_a?(::Array)\n values = values.reject(&:blank?)\n return '' if values.length.zero?\n\n \"#{separator}#{values.join(separator)}\"\n"
90
- },
91
62
  {
92
63
  "name": "join_post",
93
64
  "description": "join an array of values with separator as a string and using the separator at the end of string",
@@ -48,6 +48,16 @@ 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
+
51
61
  self
52
62
  end
53
63
 
@@ -35,21 +35,6 @@ KManager.action :array_commands do
35
35
  "#{separator}#{values.join(separator)}"
36
36
  RUBY
37
37
  end
38
- .cmdlet do
39
- name :join_pre
40
- description 'join an array of values with separator as a string and using the separator at the beginning of string'
41
-
42
- parameter :values, 'array of values to join', param_type: 'String|Int'
43
- parameter :separator, 'separator between values, defaults to comma', default: "','"
44
-
45
- ruby <<-'RUBY'
46
- return '' if values.nil? || !values.is_a?(::Array)
47
- values = values.reject(&:blank?)
48
- return '' if values.length.zero?
49
-
50
- "#{separator}#{values.join(separator)}"
51
- RUBY
52
- end
53
38
  .cmdlet do
54
39
  name :join_post
55
40
  description 'join an array of values with separator as a string and using the separator at the end of string'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [0.6.1](https://github.com/klueless-io/cmdlet/compare/v0.6.0...v0.6.1) (2022-07-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add alias :parse, :call ([328e0e5](https://github.com/klueless-io/cmdlet/commit/328e0e56050277fcee5c4e867f628afaf21f0d25))
7
+ * add alias :parse, :call ([ea54e24](https://github.com/klueless-io/cmdlet/commit/ea54e2444f3b22d4c790c0aba9dc82c232527bcc))
8
+
9
+ # [0.6.0](https://github.com/klueless-io/cmdlet/compare/v0.5.0...v0.6.0) (2022-07-13)
10
+
11
+
12
+ ### Features
13
+
14
+ * align cmdlet/helper GEM versions ([3fcf532](https://github.com/klueless-io/cmdlet/commit/3fcf532686d646492095cbb31ab08a9213b283b9))
15
+
16
+ # [0.5.0](https://github.com/klueless-io/cmdlet/compare/v0.4.2...v0.5.0) (2022-07-12)
17
+
18
+
19
+ ### Features
20
+
21
+ * add inflection: pluralize_number and pluralize_number_word ([53b1d00](https://github.com/klueless-io/cmdlet/commit/53b1d00fa44da710a480935d41f26966702d1ae6))
22
+
1
23
  ## [0.4.2](https://github.com/klueless-io/cmdlet/compare/v0.4.1...v0.4.2) (2022-07-12)
2
24
 
3
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cmdlet
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.2'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "cmdlet",
3
- "version": "0.5.0",
3
+ "version": "0.6.2",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "cmdlet",
9
- "version": "0.5.0",
9
+ "version": "0.6.2",
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.5.0",
3
+ "version": "0.6.2",
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.5.0
4
+ version: 0.6.2
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-12 00:00:00.000000000 Z
11
+ date: 2022-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.3
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.3
40
+ version: '0'
41
41
  description: " Cmdlet provides a set of functions (wrapped in the command pattern)
42
42
  that perform simple actions\n"
43
43
  email:
@@ -51,6 +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
55
  - ".builders/.templates/handlebars_helper_require_all.rb"
55
56
  - ".builders/.templates/handlebars_helper_spec.rb"
56
57
  - ".builders/_.rb"