handlebarsjs 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58a93fc0ff8ee926166b36c99e17e122d5a021a47baeb8333723d92a14afdbf8
4
- data.tar.gz: 5f63d1066db8a9d0163b46b43a54ac59536d3e06e2bd2297cf53291c01d69a1b
3
+ metadata.gz: 32d0cd3d55545bf49ae8486479829203e3216ab77a1b86604e7c2f9f50940c34
4
+ data.tar.gz: e9ea077cd19602f48176d3b41bf406166fa227bef848af7d2c1bd1fcc3d14e69
5
5
  SHA512:
6
- metadata.gz: 32659c1788e4a22ce665315bfcf893333d3fa07510eda438d8bba3c007acf3501ab08dfe73d153517c2e2515b5eefa398a16551d5eccc60e69654a970c7d0951
7
- data.tar.gz: 8ffda416eda0a82362b6cac19ca52a2260aa768d62bb9926b8ca0abd54d81e42acf18b6780a122141abd0c68a1559e770d3e558b7c89ab8c2025ea0464a50d7f
6
+ metadata.gz: 1a4ddb649bb51fe9d4c69db398359900110875c735f1cf7f173ead88ffd6efe00242805b3fabf74d29fad824803a36840d5c22baefb0cb5b50b0b811ffb71d33
7
+ data.tar.gz: 25f2430f5a18232d231d7f0d38b9a10c990d2ea928b5b1a44b0d232c3b4f5638bebcda09e36a49e4be7767b1bba4d1b0e50bc7f36b261fd3ac903295ddba4cde
data/.rubocop.yml CHANGED
@@ -15,7 +15,7 @@ Metrics/BlockLength:
15
15
  Exclude:
16
16
  - "**/spec/**/*"
17
17
  - "*.gemspec"
18
- IgnoredMethods:
18
+ AllowedMethods:
19
19
  - configure
20
20
  - context
21
21
  - define
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.9.0](https://github.com/klueless-io/handlebarsjs/compare/v0.8.0...v0.9.0) (2022-07-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * add safe support ([edc7062](https://github.com/klueless-io/handlebarsjs/commit/edc70623130ca6ae397b3532e4609ffd825cd7a3))
7
+
1
8
  # [0.8.0](https://github.com/klueless-io/handlebarsjs/compare/v0.7.0...v0.8.0) (2022-07-16)
2
9
 
3
10
 
data/lib/_.rb CHANGED
@@ -32,3 +32,5 @@ require_relative 'handlebarsjs/helpers/inflection/pluralize_number'
32
32
  require_relative 'handlebarsjs/helpers/inflection/pluralize_number_word'
33
33
  require_relative 'handlebarsjs/helpers/inflection/singularize'
34
34
  require_relative 'handlebarsjs/helpers/misc/safe'
35
+ require_relative 'handlebarsjs/helpers/str/padl'
36
+ require_relative 'handlebarsjs/helpers/str/padr'
@@ -9,6 +9,7 @@ module Handlebarsjs
9
9
  add_comparison_defaults
10
10
  add_inflection_defaults
11
11
  add_misc_defaults
12
+ add_str_defaults
12
13
  end
13
14
 
14
15
  def add_array_defaults
@@ -67,5 +68,12 @@ module Handlebarsjs
67
68
  config.handlebars.helper(:safe, Handlebarsjs::Helpers::Misc::Safe.new)
68
69
  end
69
70
  end
71
+
72
+ def add_str_defaults
73
+ KConfig.configure do |config|
74
+ config.handlebars.helper(:padl, Handlebarsjs::Helpers::Str::Padl.new)
75
+ config.handlebars.helper(:padr, Handlebarsjs::Helpers::Str::Padr.new)
76
+ end
77
+ end
70
78
  end
71
79
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Handlebarsjs
4
+ module Helpers
5
+ # String manipulation
6
+ module Str
7
+ # Padl: take the value and give it padding on the left hand side
8
+ class Padl < Handlebarsjs::BaseHelper
9
+ register_cmdlet(Cmdlet::Str::Padl)
10
+
11
+ def to_proc
12
+ ->(value, count = nil, char = nil, _opts) { wrapper(cmdlet.call(value, count, char)) }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Handlebarsjs
4
+ module Helpers
5
+ # String manipulation
6
+ module Str
7
+ # Padr: take the value and give it padding on the right hand side
8
+ class Padr < Handlebarsjs::BaseHelper
9
+ register_cmdlet(Cmdlet::Str::Padr)
10
+
11
+ def to_proc
12
+ ->(value, count = nil, char = nil, _opts) { cmdlet.call(value, count, char) }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handlebarsjs
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "handlebarsjs",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "handlebarsjs",
9
- "version": "0.9.0",
9
+ "version": "0.10.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handlebarsjs",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "handlebarsjs GEM wraps the handlebars.js library and provides ruby/javascript interoperability",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebarsjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
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-16 00:00:00.000000000 Z
11
+ date: 2022-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdlet
@@ -69,7 +69,6 @@ files:
69
69
  - ".builders/director/handlebars_helper_director.rb"
70
70
  - ".builders/generators/01-bootstrap.rb"
71
71
  - ".builders/generators/domain_model.rb"
72
- - ".builders/generators/helpers/comparison_helpers.rb"
73
72
  - ".builders/generators/project-plan.rb"
74
73
  - ".releaserc.json"
75
74
  - ".rspec"
@@ -129,6 +128,8 @@ files:
129
128
  - lib/handlebarsjs/helpers/inflection/pluralize_number_word.rb
130
129
  - lib/handlebarsjs/helpers/inflection/singularize.rb
131
130
  - lib/handlebarsjs/helpers/misc/safe.rb
131
+ - lib/handlebarsjs/helpers/str/padl.rb
132
+ - lib/handlebarsjs/helpers/str/padr.rb
132
133
  - lib/handlebarsjs/javascript.rb
133
134
  - lib/handlebarsjs/javascript/handlebars-4.7.7.js
134
135
  - lib/handlebarsjs/javascript/handlebars-api.js
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # base_class_require 'handlebars/helpers/comparison/base_helper'
4
- # base_class 'Handlebars::Helpers::Comparison::BaseHelper'
5
- # example_input_value 'var1 and var2'
6
- # example_output_value 'truthy block'
7
- # test_input_value 'var1 and var2'
8
- # test_output_value 'truthy block'
9
-
10
- KManager.action :comparison_helpers do
11
- action do
12
- common = OpenStruct.new(
13
- category_name: 'comparison',
14
- category_description: 'Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc.'
15
- )
16
-
17
- HandlebarsHelperDirector
18
- .init(k_builder, on_exist: :write, on_action: :execute)
19
- .helper do
20
- category common.category_name
21
- category_description common.category_description
22
- name 'and'
23
- description 'And: Block helper that renders a block if **all of** the given values are truthy. If an inverse block is specified it will be rendered when falsy.'
24
- result "return block when every value is truthy"
25
- parameter('values', 'list of values (via *splat) to be checked via AND condition', splat: true)
26
-
27
- example <<-TEXT
28
- {{#if (and p1 p2 p3 p4 p5)}}
29
- found
30
- {{/if}}
31
- TEXT
32
-
33
- example <<-TEXT
34
- {{#if (and name age)}}
35
- {{name}}-{{age}}
36
- {{else}}
37
- no name or age
38
- {{/if}}
39
- TEXT
40
- end
41
- .build_helpers
42
- .debug
43
- end
44
- end