handlebarsjs 0.6.1 → 0.7.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: f97d40c892a6138efa85a40317ce6c4f6f629ce96bd365c0846361c96fad7af5
4
- data.tar.gz: 0bcca7a51b1aa79a8988a72d68fe0c3384fbc68dde3ac06a8f8b7621b835f2a3
3
+ metadata.gz: 4962fdcc88f1a68831b1907b713aa3f8996ca23dee96da1d970545a2875c0b44
4
+ data.tar.gz: 3eaa1ec0405fc12467286ac2e0db49af24269f7fe589e0365ce16439b43799c3
5
5
  SHA512:
6
- metadata.gz: dd370606ce72b0c94cfb75a2d0b3342b749f5841517128602db72e8ec2543fda37ab113633deb2ca1fe5b2c4b69bf8915acddf5deb09b48a9aade2f108f69a8c
7
- data.tar.gz: bdd9b529472893a67d2fa0bc069ff36f7f859367308d8b0cecf1621c07ce5574e01fae72335e5ce239b2a6ae72ef76f867ca0a5ca016d6909c731fe19750e92a
6
+ metadata.gz: a5aa1c58ae7e8de87949843cd3b6d90abcc04928c55a97181fca747b64aa7e2e53af87c16ee89c05112136dc8723b521caf1058948476ce7c38db46030d6a6b9
7
+ data.tar.gz: f50f5ad4daff693c4c9b0ef2f3756f2073b952165178831ac0e7361986021d0d54e100aae0647fc66aa7dd58d0173dd5639901c842349a61df5ce57025525830
data/.builders/boot.rb CHANGED
@@ -6,34 +6,11 @@ CONFIG_KEY = :handlebarsjs
6
6
 
7
7
  log.kv 'working folder', Dir.pwd
8
8
 
9
- Handlebars::Helpers.configure do |config|
10
- config.helper_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_helpers.json')
11
- config.string_formatter_config_file = File.join(Gem.loaded_specs['handlebars-helpers'].full_gem_path, '.handlebars_string_formatters.json')
12
- end
13
-
14
- def camel
15
- require 'handlebars/helpers/string_formatting/camel'
16
- Handlebars::Helpers::StringFormatting::Camel.new
17
- end
18
-
19
- def titleize
20
- require 'handlebars/helpers/string_formatting/titleize'
21
- Handlebars::Helpers::StringFormatting::Titleize.new
22
- end
23
-
24
- def pluralize
25
- require 'handlebars/helpers/inflection/pluralize'
26
- Handlebars::Helpers::Inflection::Pluralize.new
27
- end
28
-
29
- def singularize
30
- require 'handlebars/helpers/inflection/singularize'
31
- Handlebars::Helpers::Inflection::Singularize.new
32
- end
33
-
34
- def dasherize
35
- require 'handlebars/helpers/string_formatting/dasherize'
36
- Handlebars::Helpers::StringFormatting::Dasherize.new
9
+ KConfig.configure do |config|
10
+ config.handlebars.defaults.add_array_defaults
11
+ config.handlebars.defaults.add_case_defaults
12
+ config.handlebars.defaults.add_comparison_defaults
13
+ config.handlebars.defaults.add_inflection_defaults
37
14
  end
38
15
 
39
16
  def k_builder
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# \*\*']
44
+ AllowedPatterns: ['\A# \*\*']
45
45
  IgnoreCopDirectives: true
46
46
 
47
47
  Lint/UnusedMethodArgument:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [0.6.3](https://github.com/klueless-io/handlebarsjs/compare/v0.6.2...v0.6.3) (2022-07-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add_all_defaults to configuration ([5755639](https://github.com/klueless-io/handlebarsjs/commit/575563988b17eb17807ce7b7b2ca76e06eba796d))
7
+
8
+ ## [0.6.2](https://github.com/klueless-io/handlebarsjs/compare/v0.6.1...v0.6.2) (2022-07-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update rubocop.yml ([2188ecd](https://github.com/klueless-io/handlebarsjs/commit/2188ecdf7cd1201dbf60087a21467bc598c55c70))
14
+ * update rubocop.yml ([006b69a](https://github.com/klueless-io/handlebarsjs/commit/006b69a061f5acd2d15e302c321730621cf5a212))
15
+
16
+ ## [0.6.1](https://github.com/klueless-io/handlebarsjs/compare/v0.6.0...v0.6.1) (2022-07-13)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * add configuration and bump mini_racer, libv8 version ([7295f1d](https://github.com/klueless-io/handlebarsjs/commit/7295f1d98d9f461b4c95fd9ad587b2c9a37bbb96))
22
+
1
23
  # [0.6.0](https://github.com/klueless-io/handlebarsjs/compare/v0.5.7...v0.6.0) (2022-07-13)
2
24
 
3
25
 
@@ -16,8 +16,13 @@ module Handlebarsjs
16
16
 
17
17
  HelperConfig = Struct.new(:name, :helper)
18
18
 
19
- def helper(name, helper)
20
- @helpers << HelperConfig.new(name, helper)
19
+ def helper(name, helper, aliases: [])
20
+ names = [name.to_sym]
21
+ names = (names + aliases.map(&:to_sym)).uniq
22
+
23
+ names.each do |helper_name|
24
+ @helpers << HelperConfig.new(helper_name, helper)
25
+ end
21
26
  end
22
27
  end
23
28
  end
@@ -3,29 +3,36 @@
3
3
  module Handlebarsjs
4
4
  # Pre-configure default helpers for each category
5
5
  class HandlebarsConfigurationDefaults
6
+ def add_all_defaults
7
+ add_array_defaults
8
+ add_case_defaults
9
+ add_comparison_defaults
10
+ add_inflection_defaults
11
+ end
12
+
6
13
  def add_array_defaults
7
14
  KConfig.configure do |config|
8
15
  config.handlebars.helper(:join, Handlebarsjs::Helpers::Array::Join.new)
9
- config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
10
16
  config.handlebars.helper(:join_post, Handlebarsjs::Helpers::Array::JoinPost.new)
17
+ config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
11
18
  end
12
19
  end
13
20
 
14
21
  def add_case_defaults
15
22
  KConfig.configure do |config|
16
- config.handlebars.helper(:back_slash, Handlebarsjs::Helpers::Case::BackSlash.new)
17
- config.handlebars.helper(:camel, Handlebarsjs::Helpers::Case::Camel.new)
18
- config.handlebars.helper(:constant, Handlebarsjs::Helpers::Case::Constant.new)
19
- config.handlebars.helper(:dash, Handlebarsjs::Helpers::Case::Dash.new)
20
- config.handlebars.helper(:dot, Handlebarsjs::Helpers::Case::Dot.new)
23
+ config.handlebars.helper(:back_slash, Handlebarsjs::Helpers::Case::BackSlash.new, aliases: %i[backward_slash slash_backward])
24
+ config.handlebars.helper(:camel, Handlebarsjs::Helpers::Case::Camel.new, aliases: %i[camel_upper camelUpper camelU pascalcase])
25
+ config.handlebars.helper(:constant, Handlebarsjs::Helpers::Case::Constant.new, aliases: %i[constantize])
26
+ config.handlebars.helper(:dash, Handlebarsjs::Helpers::Case::Dash.new, aliases: %i[dasherize dashify dashcase hyphenate])
27
+ config.handlebars.helper(:dot, Handlebarsjs::Helpers::Case::Dot.new, aliases: %i[dotirize dotify dotcase hyphenate])
21
28
  config.handlebars.helper(:double_colon, Handlebarsjs::Helpers::Case::DoubleColon.new)
22
- config.handlebars.helper(:human, Handlebarsjs::Helpers::Case::Human.new)
23
- config.handlebars.helper(:lamel, Handlebarsjs::Helpers::Case::Lamel.new)
24
- config.handlebars.helper(:lower, Handlebarsjs::Helpers::Case::Lower.new)
25
- config.handlebars.helper(:slash, Handlebarsjs::Helpers::Case::Slash.new)
29
+ config.handlebars.helper(:human, Handlebarsjs::Helpers::Case::Human.new, aliases: %i[humanize sentence])
30
+ config.handlebars.helper(:lamel, Handlebarsjs::Helpers::Case::Lamel.new, aliases: %i[camel_lower camelLower camelL])
31
+ config.handlebars.helper(:lower, Handlebarsjs::Helpers::Case::Lower.new, aliases: %i[lowercase downcase])
32
+ config.handlebars.helper(:slash, Handlebarsjs::Helpers::Case::Slash.new, aliases: %i[forward_slash slash_forward])
26
33
  config.handlebars.helper(:snake, Handlebarsjs::Helpers::Case::Snake.new)
27
34
  config.handlebars.helper(:title, Handlebarsjs::Helpers::Case::Title.new)
28
- config.handlebars.helper(:upper, Handlebarsjs::Helpers::Case::Upper.new)
35
+ config.handlebars.helper(:upper, Handlebarsjs::Helpers::Case::Upper.new, aliases: %i[upcase uppercase])
29
36
  end
30
37
  end
31
38
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handlebarsjs
4
- VERSION = '0.6.1'
4
+ VERSION = '0.7.0'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "handlebarsjs",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "handlebarsjs",
9
- "version": "0.6.1",
9
+ "version": "0.7.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.6.1",
3
+ "version": "0.7.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.6.1
4
+ version: 0.7.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-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: cmdlet
@@ -97,7 +97,6 @@ files:
97
97
  - lib/handlebarsjs/handlebars_configuration_defaults.rb
98
98
  - lib/handlebarsjs/handlebars_configuration_extension.rb
99
99
  - lib/handlebarsjs/handlebars_snapshot.rb
100
- - lib/handlebarsjs/helpers/array/default_configuration.rb
101
100
  - lib/handlebarsjs/helpers/array/join.rb
102
101
  - lib/handlebarsjs/helpers/array/join_post.rb
103
102
  - lib/handlebarsjs/helpers/array/join_pre.rb
@@ -105,7 +104,6 @@ files:
105
104
  - lib/handlebarsjs/helpers/case/camel.rb
106
105
  - lib/handlebarsjs/helpers/case/constant.rb
107
106
  - lib/handlebarsjs/helpers/case/dash.rb
108
- - lib/handlebarsjs/helpers/case/default_configuration.rb
109
107
  - lib/handlebarsjs/helpers/case/dot.rb
110
108
  - lib/handlebarsjs/helpers/case/double_colon.rb
111
109
  - lib/handlebarsjs/helpers/case/human.rb
@@ -117,7 +115,6 @@ files:
117
115
  - lib/handlebarsjs/helpers/case/upper.rb
118
116
  - lib/handlebarsjs/helpers/comparison/and.rb
119
117
  - lib/handlebarsjs/helpers/comparison/default.rb
120
- - lib/handlebarsjs/helpers/comparison/default_configuration.rb
121
118
  - lib/handlebarsjs/helpers/comparison/eq.rb
122
119
  - lib/handlebarsjs/helpers/comparison/gt.rb
123
120
  - lib/handlebarsjs/helpers/comparison/gte.rb
@@ -125,7 +122,6 @@ files:
125
122
  - lib/handlebarsjs/helpers/comparison/lte.rb
126
123
  - lib/handlebarsjs/helpers/comparison/ne.rb
127
124
  - lib/handlebarsjs/helpers/comparison/or.rb
128
- - lib/handlebarsjs/helpers/inflection/default_configuration.rb
129
125
  - lib/handlebarsjs/helpers/inflection/ordinal.rb
130
126
  - lib/handlebarsjs/helpers/inflection/ordinalize.rb
131
127
  - lib/handlebarsjs/helpers/inflection/pluralize.rb
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KConfig.configure do |config|
4
- config.handlebars.helper(:join, Handlebarsjs::Helpers::Array::Join.new)
5
- config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
6
- config.handlebars.helper(:join_post, Handlebarsjs::Helpers::Array::JoinPost.new)
7
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KConfig.configure do |config|
4
- config.handlebars.helper(:back_slash, Handlebarsjs::Helpers::Case::BackSlash.new)
5
- config.handlebars.helper(:camel, Handlebarsjs::Helpers::Case::Camel.new)
6
- config.handlebars.helper(:constant, Handlebarsjs::Helpers::Case::Constant.new)
7
- config.handlebars.helper(:dash, Handlebarsjs::Helpers::Case::Dash.new)
8
- config.handlebars.helper(:dot, Handlebarsjs::Helpers::Case::Dot.new)
9
- config.handlebars.helper(:double_colon, Handlebarsjs::Helpers::Case::DoubleColon.new)
10
- config.handlebars.helper(:human, Handlebarsjs::Helpers::Case::Human.new)
11
- config.handlebars.helper(:lamel, Handlebarsjs::Helpers::Case::Lamel.new)
12
- config.handlebars.helper(:lower, Handlebarsjs::Helpers::Case::Lower.new)
13
- config.handlebars.helper(:slash, Handlebarsjs::Helpers::Case::Slash.new)
14
- config.handlebars.helper(:snake, Handlebarsjs::Helpers::Case::Snake.new)
15
- config.handlebars.helper(:title, Handlebarsjs::Helpers::Case::Title.new)
16
- config.handlebars.helper(:upper, Handlebarsjs::Helpers::Case::Upper.new)
17
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KConfig.configure do |config|
4
- config.handlebars.helper(:and, Handlebarsjs::Helpers::Comparison::And.new)
5
- config.handlebars.helper(:default, Handlebarsjs::Helpers::Comparison::Default.new)
6
- config.handlebars.helper(:eq, Handlebarsjs::Helpers::Comparison::Eq.new)
7
- config.handlebars.helper(:gt, Handlebarsjs::Helpers::Comparison::Gt.new)
8
- config.handlebars.helper(:gte, Handlebarsjs::Helpers::Comparison::Gte.new)
9
- config.handlebars.helper(:lt, Handlebarsjs::Helpers::Comparison::Lt.new)
10
- config.handlebars.helper(:lte, Handlebarsjs::Helpers::Comparison::Lte.new)
11
- config.handlebars.helper(:ne, Handlebarsjs::Helpers::Comparison::Ne.new)
12
- config.handlebars.helper(:or, Handlebarsjs::Helpers::Comparison::Or.new)
13
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- KConfig.configure do |config|
4
- config.handlebars.helper(:ordinal, Handlebarsjs::Helpers::Inflection::Ordinal.new)
5
- config.handlebars.helper(:ordinalize, Handlebarsjs::Helpers::Inflection::Ordinalize.new)
6
- config.handlebars.helper(:pluralize, Handlebarsjs::Helpers::Inflection::Pluralize.new)
7
- config.handlebars.helper(:pluralize_number, Handlebarsjs::Helpers::Inflection::PluralizeNumber.new)
8
- config.handlebars.helper(:pluralize_number_word, Handlebarsjs::Helpers::Inflection::PluralizeNumberWord.new)
9
- config.handlebars.helper(:singularize, Handlebarsjs::Helpers::Inflection::Singularize.new)
10
- end