handlebarsjs 0.6.0 → 0.6.1

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: be20a900e92e33b726da6c5807cba1e183e15c3642fc75493370230ef7f04326
4
- data.tar.gz: '069b8b8358aefa0b753d55883e1c52b53698d94dcf7c9660a019f7d3713789b3'
3
+ metadata.gz: f97d40c892a6138efa85a40317ce6c4f6f629ce96bd365c0846361c96fad7af5
4
+ data.tar.gz: 0bcca7a51b1aa79a8988a72d68fe0c3384fbc68dde3ac06a8f8b7621b835f2a3
5
5
  SHA512:
6
- metadata.gz: 79cf9b5f22b8d20fab6d626c11ebedb8d31a52d0c7122f9587d86bd925b3792a9af91aad2ea27d29d360414f91710a9f85ac7e4f3191cd95dda8c6f514c28fa8
7
- data.tar.gz: d29ad4299dc2d9579dd2e31ffbb2abc653fe4d65b9f2ed013e67f0cc20801ca1a8e0d39e72e61ef0b5118bdcb05c5a4c5181f1a293f88bc03400199f2d32cac6
6
+ metadata.gz: dd370606ce72b0c94cfb75a2d0b3342b749f5841517128602db72e8ec2543fda37ab113633deb2ca1fe5b2c4b69bf8915acddf5deb09b48a9aade2f108f69a8c
7
+ data.tar.gz: bdd9b529472893a67d2fa0bc069ff36f7f859367308d8b0cecf1621c07ce5574e01fae72335e5ce239b2a6ae72ef76f867ca0a5ca016d6909c731fe19750e92a
data/.rubocop.yml CHANGED
@@ -87,3 +87,6 @@ Layout/SpaceBeforeComma:
87
87
  Enabled: false
88
88
  # My Preferences - End
89
89
 
90
+ Metrics/AbcSize:
91
+ Exclude:
92
+ - "lib/handlebarsjs/handlebars_configuration_defaults.rb"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.6.0](https://github.com/klueless-io/handlebarsjs/compare/v0.5.7...v0.6.0) (2022-07-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * align cmdlet/helper GEM versions ([396bed1](https://github.com/klueless-io/handlebarsjs/commit/396bed1e44a865cca51bed0ba2190d099f69c8d3))
7
+
1
8
  ## [0.5.7](https://github.com/klueless-io/handlebarsjs/compare/v0.5.6...v0.5.7) (2022-07-13)
2
9
 
3
10
 
@@ -1,24 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handlebarsjs
4
- # Register this configuration access extension for Handlebars configuration
5
- module HandlebarsConfigurationExtension
6
- def handlebars
7
- return @handlebars if defined? @handlebars
8
-
9
- @handlebars = HandlebarsConfiguration.new
10
- end
11
- end
12
-
13
4
  # handlebars.handlebars_snapshot.add_helper(helper_name, helper)
14
5
  # Structure for storing Cmdlet configuration
15
6
  class HandlebarsConfiguration
16
7
  include KLog::Logging
17
8
 
18
9
  attr_accessor :helpers
10
+ attr_reader :defaults
19
11
 
20
12
  def initialize
21
13
  @helpers = []
14
+ @defaults = Handlebarsjs::HandlebarsConfigurationDefaults.new
22
15
  end
23
16
 
24
17
  HelperConfig = Struct.new(:name, :helper)
@@ -28,5 +21,3 @@ module Handlebarsjs
28
21
  end
29
22
  end
30
23
  end
31
-
32
- KConfig::Configuration.register(:handlebars, Handlebarsjs::HandlebarsConfigurationExtension)
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Handlebarsjs
4
+ # Pre-configure default helpers for each category
5
+ class HandlebarsConfigurationDefaults
6
+ def add_array_defaults
7
+ KConfig.configure do |config|
8
+ config.handlebars.helper(:join, Handlebarsjs::Helpers::Array::Join.new)
9
+ config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
10
+ config.handlebars.helper(:join_post, Handlebarsjs::Helpers::Array::JoinPost.new)
11
+ end
12
+ end
13
+
14
+ def add_case_defaults
15
+ 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)
21
+ 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)
26
+ config.handlebars.helper(:snake, Handlebarsjs::Helpers::Case::Snake.new)
27
+ config.handlebars.helper(:title, Handlebarsjs::Helpers::Case::Title.new)
28
+ config.handlebars.helper(:upper, Handlebarsjs::Helpers::Case::Upper.new)
29
+ end
30
+ end
31
+
32
+ def add_comparison_defaults
33
+ KConfig.configure do |config|
34
+ config.handlebars.helper(:and, Handlebarsjs::Helpers::Comparison::And.new)
35
+ config.handlebars.helper(:default, Handlebarsjs::Helpers::Comparison::Default.new)
36
+ config.handlebars.helper(:eq, Handlebarsjs::Helpers::Comparison::Eq.new)
37
+ config.handlebars.helper(:gt, Handlebarsjs::Helpers::Comparison::Gt.new)
38
+ config.handlebars.helper(:gte, Handlebarsjs::Helpers::Comparison::Gte.new)
39
+ config.handlebars.helper(:lt, Handlebarsjs::Helpers::Comparison::Lt.new)
40
+ config.handlebars.helper(:lte, Handlebarsjs::Helpers::Comparison::Lte.new)
41
+ config.handlebars.helper(:ne, Handlebarsjs::Helpers::Comparison::Ne.new)
42
+ config.handlebars.helper(:or, Handlebarsjs::Helpers::Comparison::Or.new)
43
+ end
44
+ end
45
+
46
+ def add_inflection_defaults
47
+ KConfig.configure do |config|
48
+ config.handlebars.helper(:ordinal, Handlebarsjs::Helpers::Inflection::Ordinal.new)
49
+ config.handlebars.helper(:ordinalize, Handlebarsjs::Helpers::Inflection::Ordinalize.new)
50
+ config.handlebars.helper(:pluralize, Handlebarsjs::Helpers::Inflection::Pluralize.new)
51
+ config.handlebars.helper(:pluralize_number, Handlebarsjs::Helpers::Inflection::PluralizeNumber.new)
52
+ config.handlebars.helper(:pluralize_number_word, Handlebarsjs::Helpers::Inflection::PluralizeNumberWord.new)
53
+ config.handlebars.helper(:singularize, Handlebarsjs::Helpers::Inflection::Singularize.new)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Handlebarsjs
4
+ # Register this configuration access extension for Handlebars configuration
5
+ module HandlebarsConfigurationExtension
6
+ def handlebars
7
+ return @handlebars if defined? @handlebars
8
+
9
+ @handlebars = HandlebarsConfiguration.new
10
+ end
11
+ end
12
+ end
13
+
14
+ KConfig::Configuration.register(:handlebars, Handlebarsjs::HandlebarsConfigurationExtension)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handlebarsjs
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
data/lib/handlebarsjs.rb CHANGED
@@ -3,11 +3,13 @@
3
3
  require 'mini_racer'
4
4
  require 'cmdlet'
5
5
  require_relative 'handlebarsjs/version'
6
- require_relative 'handlebarsjs/configuration'
7
6
  require_relative 'handlebarsjs/javascript'
8
7
  require_relative 'handlebarsjs/handlebars_snapshot'
9
8
  require_relative 'handlebarsjs/handlebars'
10
9
  require_relative 'handlebarsjs/base_helper'
10
+ require_relative 'handlebarsjs/handlebars_configuration_defaults'
11
+ require_relative 'handlebarsjs/handlebars_configuration'
12
+ require_relative 'handlebarsjs/handlebars_configuration_extension'
11
13
  require_relative '_'
12
14
 
13
15
  # Handlebarsjs is a Ruby wrapper for the Handlebars.js templating engine.
@@ -36,7 +38,7 @@ module Handlebarsjs
36
38
  end
37
39
 
38
40
  def render(template, options = {})
39
- @engine.process_template(template, options)
41
+ engine.process_template(template, options)
40
42
  end
41
43
  end
42
44
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "handlebarsjs",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "handlebarsjs",
9
- "version": "0.6.0",
9
+ "version": "0.6.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": "handlebarsjs",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebarsjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.0
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.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mini_racer
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.6'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.6'
55
55
  description: " handlebarsjs GEM wraps the handlebars.js library and provides ruby/javascript
56
56
  interoperability\n"
57
57
  email:
@@ -92,8 +92,10 @@ files:
92
92
  - lib/_.rb
93
93
  - lib/handlebarsjs.rb
94
94
  - lib/handlebarsjs/base_helper.rb
95
- - lib/handlebarsjs/configuration.rb
96
95
  - lib/handlebarsjs/handlebars.rb
96
+ - lib/handlebarsjs/handlebars_configuration.rb
97
+ - lib/handlebarsjs/handlebars_configuration_defaults.rb
98
+ - lib/handlebarsjs/handlebars_configuration_extension.rb
97
99
  - lib/handlebarsjs/handlebars_snapshot.rb
98
100
  - lib/handlebarsjs/helpers/array/default_configuration.rb
99
101
  - lib/handlebarsjs/helpers/array/join.rb