handlebarsjs 0.6.2 → 0.8.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 +4 -4
- data/CHANGELOG.md +22 -0
- data/lib/_.rb +1 -0
- data/lib/handlebarsjs/base_helper.rb +30 -4
- data/lib/handlebarsjs/handlebars.rb +18 -0
- data/lib/handlebarsjs/handlebars_configuration.rb +8 -4
- data/lib/handlebarsjs/handlebars_configuration_defaults.rb +26 -12
- data/lib/handlebarsjs/handlebars_snapshot.rb +67 -13
- data/lib/handlebarsjs/helpers/misc/safe.rb +17 -0
- data/lib/handlebarsjs/javascript/handlebars-4.7.7.js +17 -0
- data/lib/handlebarsjs/javascript/handlebars-helpers.js +10 -1
- data/lib/handlebarsjs/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +3 -6
- data/lib/handlebarsjs/helpers/array/default_configuration.rb +0 -7
- data/lib/handlebarsjs/helpers/case/default_configuration.rb +0 -17
- data/lib/handlebarsjs/helpers/comparison/default_configuration.rb +0 -13
- data/lib/handlebarsjs/helpers/inflection/default_configuration.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d738c40219cfaa348afd07afcb59bc572ea7ee40d2cb35f5b28f7b9273e05e01
|
4
|
+
data.tar.gz: 65f1494627bc268671e240d1d133a73dd79ccbdfdbbb3f0eb38baa19831cff47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a720a3372be65f40f4e43450c480b416679366011eda8e3d6fc9dc479ddbbcc05d11a3f408fed14d9da7c615cea72d890afffc9c142a2e31f18c8ab5e606d30
|
7
|
+
data.tar.gz: 46c659bce100021e60775a1b1b25faeb399cdc6caf8747dee1778eef395be16aa20f2bd0c5a3f1ee45a86044b320ba919117ae52f13ccd85a9fa325542e82acf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# [0.7.0](https://github.com/klueless-io/handlebarsjs/compare/v0.6.3...v0.7.0) (2022-07-15)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* add alias support ([ae81c61](https://github.com/klueless-io/handlebarsjs/commit/ae81c61d569dd44e9ae50832f69a0f29d30e9523))
|
7
|
+
|
8
|
+
## [0.6.3](https://github.com/klueless-io/handlebarsjs/compare/v0.6.2...v0.6.3) (2022-07-14)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* add_all_defaults to configuration ([5755639](https://github.com/klueless-io/handlebarsjs/commit/575563988b17eb17807ce7b7b2ca76e06eba796d))
|
14
|
+
|
15
|
+
## [0.6.2](https://github.com/klueless-io/handlebarsjs/compare/v0.6.1...v0.6.2) (2022-07-13)
|
16
|
+
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
* update rubocop.yml ([2188ecd](https://github.com/klueless-io/handlebarsjs/commit/2188ecdf7cd1201dbf60087a21467bc598c55c70))
|
21
|
+
* update rubocop.yml ([006b69a](https://github.com/klueless-io/handlebarsjs/commit/006b69a061f5acd2d15e302c321730621cf5a212))
|
22
|
+
|
1
23
|
## [0.6.1](https://github.com/klueless-io/handlebarsjs/compare/v0.6.0...v0.6.1) (2022-07-13)
|
2
24
|
|
3
25
|
|
data/lib/_.rb
CHANGED
@@ -31,3 +31,4 @@ require_relative 'handlebarsjs/helpers/inflection/pluralize'
|
|
31
31
|
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
|
+
require_relative 'handlebarsjs/helpers/misc/safe'
|
@@ -4,20 +4,27 @@ module Handlebarsjs
|
|
4
4
|
# Extend base helper for each of your custom handlebars-helpers
|
5
5
|
class BaseHelper
|
6
6
|
attr_reader :cmdlet
|
7
|
+
attr_reader :safe
|
8
|
+
attr_reader :parameter_names
|
7
9
|
|
8
10
|
# Preferred way to register the internal command is via register_cmdlet
|
9
11
|
# but you can also register the command directly in the initializer and
|
10
12
|
# that can be handy if you use a custom configured cmdlet
|
11
|
-
def initialize(cmdlet = nil)
|
12
|
-
|
13
|
-
|
13
|
+
def initialize(cmdlet = nil, safe: nil, parameter_names: nil)
|
14
|
+
initialize_cmdlet(cmdlet)
|
15
|
+
initialize_safe(safe)
|
16
|
+
initialize_parameter_names(parameter_names)
|
14
17
|
end
|
15
18
|
|
16
19
|
class << self
|
17
20
|
attr_reader :cmdlet
|
21
|
+
attr_reader :safe
|
22
|
+
attr_reader :parameter_names
|
18
23
|
|
19
|
-
def register_cmdlet(cmdlet)
|
24
|
+
def register_cmdlet(cmdlet, safe: false, parameter_names: [])
|
20
25
|
@cmdlet = cmdlet
|
26
|
+
@safe = safe
|
27
|
+
@parameter_names = parameter_names
|
21
28
|
end
|
22
29
|
end
|
23
30
|
|
@@ -33,5 +40,24 @@ module Handlebarsjs
|
|
33
40
|
def to_proc
|
34
41
|
->(value, _opts) { wrapper(cmdlet.call(value)) }
|
35
42
|
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def initialize_cmdlet(cmdlet)
|
47
|
+
@cmdlet = cmdlet
|
48
|
+
@cmdlet = self.class.cmdlet.new if @cmdlet.nil? && self.class.cmdlet
|
49
|
+
end
|
50
|
+
|
51
|
+
def initialize_safe(safe)
|
52
|
+
@safe = safe
|
53
|
+
@safe = self.class.safe if @safe.nil? && self.class.safe
|
54
|
+
@safe = false if @safe.nil?
|
55
|
+
end
|
56
|
+
|
57
|
+
def initialize_parameter_names(parameter_names)
|
58
|
+
@parameter_names = parameter_names
|
59
|
+
@parameter_names = self.class.parameter_names if parameter_names.nil? && self.class.parameter_names
|
60
|
+
@parameter_names = [] if @parameter_names.nil?
|
61
|
+
end
|
36
62
|
end
|
37
63
|
end
|
@@ -10,6 +10,24 @@ module Handlebarsjs
|
|
10
10
|
add_configured_helpers
|
11
11
|
end
|
12
12
|
|
13
|
+
class << self
|
14
|
+
def register_helper_script(name)
|
15
|
+
<<-JAVASCRIPT
|
16
|
+
Handlebars.registerHelper('#{name}', ruby_#{name})
|
17
|
+
JAVASCRIPT
|
18
|
+
end
|
19
|
+
|
20
|
+
def register_safe_string_helper_script(name, parameter_names)
|
21
|
+
parameters = (parameter_names + ['_opts']).join(', ')
|
22
|
+
|
23
|
+
<<-JAVASCRIPT
|
24
|
+
Handlebars.registerHelper('#{name}', function (#{parameters}) {
|
25
|
+
return new Handlebars.SafeString(ruby_#{name}(#{parameters}));
|
26
|
+
})
|
27
|
+
JAVASCRIPT
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
13
31
|
def process_template(template, options = {})
|
14
32
|
# TODO: process template function may be improved with some type of caching
|
15
33
|
context.call('process_template', template, options)
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Handlebarsjs
|
4
|
-
#
|
5
|
-
# Structure for storing Cmdlet configuration
|
4
|
+
# Configuration data such has helpers for handlebarsjs
|
6
5
|
class HandlebarsConfiguration
|
7
6
|
include KLog::Logging
|
8
7
|
|
@@ -16,8 +15,13 @@ module Handlebarsjs
|
|
16
15
|
|
17
16
|
HelperConfig = Struct.new(:name, :helper)
|
18
17
|
|
19
|
-
def helper(name, helper)
|
20
|
-
|
18
|
+
def helper(name, helper, aliases: [])
|
19
|
+
names = [name.to_sym]
|
20
|
+
names = (names + aliases.map(&:to_sym)).uniq
|
21
|
+
|
22
|
+
names.each do |helper_name|
|
23
|
+
@helpers << HelperConfig.new(helper_name, helper)
|
24
|
+
end
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
@@ -3,29 +3,37 @@
|
|
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
|
+
add_misc_defaults
|
12
|
+
end
|
13
|
+
|
6
14
|
def add_array_defaults
|
7
15
|
KConfig.configure do |config|
|
8
16
|
config.handlebars.helper(:join, Handlebarsjs::Helpers::Array::Join.new)
|
9
|
-
config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
|
10
17
|
config.handlebars.helper(:join_post, Handlebarsjs::Helpers::Array::JoinPost.new)
|
18
|
+
config.handlebars.helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new)
|
11
19
|
end
|
12
20
|
end
|
13
21
|
|
14
22
|
def add_case_defaults
|
15
23
|
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)
|
24
|
+
config.handlebars.helper(:back_slash, Handlebarsjs::Helpers::Case::BackSlash.new, aliases: %i[backward_slash slash_backward])
|
25
|
+
config.handlebars.helper(:camel, Handlebarsjs::Helpers::Case::Camel.new, aliases: %i[camel_upper camelUpper camelU pascalcase])
|
26
|
+
config.handlebars.helper(:constant, Handlebarsjs::Helpers::Case::Constant.new, aliases: %i[constantize])
|
27
|
+
config.handlebars.helper(:dash, Handlebarsjs::Helpers::Case::Dash.new, aliases: %i[dasherize dashify dashcase hyphenate])
|
28
|
+
config.handlebars.helper(:dot, Handlebarsjs::Helpers::Case::Dot.new, aliases: %i[dotirize dotify dotcase hyphenate])
|
21
29
|
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)
|
30
|
+
config.handlebars.helper(:human, Handlebarsjs::Helpers::Case::Human.new, aliases: %i[humanize sentence])
|
31
|
+
config.handlebars.helper(:lamel, Handlebarsjs::Helpers::Case::Lamel.new, aliases: %i[camel_lower camelLower camelL])
|
32
|
+
config.handlebars.helper(:lower, Handlebarsjs::Helpers::Case::Lower.new, aliases: %i[lowercase downcase])
|
33
|
+
config.handlebars.helper(:slash, Handlebarsjs::Helpers::Case::Slash.new, aliases: %i[forward_slash slash_forward])
|
26
34
|
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)
|
35
|
+
config.handlebars.helper(:title, Handlebarsjs::Helpers::Case::Title.new, aliases: %i[titleize])
|
36
|
+
config.handlebars.helper(:upper, Handlebarsjs::Helpers::Case::Upper.new, aliases: %i[upcase uppercase])
|
29
37
|
end
|
30
38
|
end
|
31
39
|
|
@@ -53,5 +61,11 @@ module Handlebarsjs
|
|
53
61
|
config.handlebars.helper(:singularize, Handlebarsjs::Helpers::Inflection::Singularize.new)
|
54
62
|
end
|
55
63
|
end
|
64
|
+
|
65
|
+
def add_misc_defaults
|
66
|
+
KConfig.configure do |config|
|
67
|
+
config.handlebars.helper(:safe, Handlebarsjs::Helpers::Misc::Safe.new)
|
68
|
+
end
|
69
|
+
end
|
56
70
|
end
|
57
71
|
end
|
@@ -25,10 +25,23 @@ module Handlebarsjs
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def add_helper(name, helper)
|
28
|
-
|
29
|
-
|
28
|
+
add_helper_entry(
|
29
|
+
name: name,
|
30
|
+
helper: helper,
|
31
|
+
callback: helper.to_proc,
|
32
|
+
safe: helper.safe,
|
33
|
+
parameters: helper.parameter_names
|
34
|
+
)
|
35
|
+
end
|
30
36
|
|
31
|
-
|
37
|
+
def add_callback(name, callback, safe, parameters)
|
38
|
+
add_helper_entry(
|
39
|
+
name: name,
|
40
|
+
helper: nil,
|
41
|
+
callback: callback,
|
42
|
+
safe: safe,
|
43
|
+
parameters: parameters
|
44
|
+
)
|
32
45
|
end
|
33
46
|
|
34
47
|
def register_helper(name)
|
@@ -43,18 +56,16 @@ module Handlebarsjs
|
|
43
56
|
@snapshot ||= MiniRacer::Snapshot.new(script)
|
44
57
|
end
|
45
58
|
|
46
|
-
# rubocop:disable Style/DocumentDynamicEvalDefinition
|
47
59
|
def new_context
|
48
60
|
context = MiniRacer::Context.new(snapshot: snapshot)
|
49
61
|
|
50
|
-
helpers.each do |
|
51
|
-
context
|
52
|
-
context
|
62
|
+
helpers.each do |helper_entry|
|
63
|
+
attach_ruby(context, helper_entry)
|
64
|
+
eval_register_helper(context, helper_entry)
|
53
65
|
end
|
54
66
|
|
55
67
|
context
|
56
68
|
end
|
57
|
-
# rubocop:enable Style/DocumentDynamicEvalDefinition
|
58
69
|
|
59
70
|
# not currently used
|
60
71
|
def dirty?
|
@@ -66,6 +77,19 @@ module Handlebarsjs
|
|
66
77
|
log.structure(data)
|
67
78
|
end
|
68
79
|
|
80
|
+
def debug_register_scripts
|
81
|
+
register_scripts = helpers.map do |helper|
|
82
|
+
# Handlebarsjs::Handlebars.register_safe_string_helper_script(
|
83
|
+
# helper[:name]
|
84
|
+
# )
|
85
|
+
# helper[:helper].build_register_helper_script(
|
86
|
+
# helper[:name],
|
87
|
+
# safe: helper[:safe]
|
88
|
+
# )
|
89
|
+
end
|
90
|
+
puts register_scripts.join("\n")
|
91
|
+
end
|
92
|
+
|
69
93
|
private
|
70
94
|
|
71
95
|
def add_script(name, type, script: nil, path: nil)
|
@@ -76,12 +100,18 @@ module Handlebarsjs
|
|
76
100
|
add_script_item(name, type, script, path)
|
77
101
|
end
|
78
102
|
|
79
|
-
def add_helper_entry(
|
80
|
-
|
81
|
-
name: name,
|
82
|
-
helper: helper,
|
83
|
-
callback: callback
|
103
|
+
def add_helper_entry(**args)
|
104
|
+
entry = {
|
105
|
+
name: args[:name],
|
106
|
+
helper: args[:helper],
|
107
|
+
callback: args[:callback],
|
108
|
+
safe: args[:safe],
|
109
|
+
parameters: args[:parameters]
|
84
110
|
}
|
111
|
+
|
112
|
+
@helpers << entry
|
113
|
+
|
114
|
+
entry
|
85
115
|
end
|
86
116
|
|
87
117
|
def add_script_item(name, type, script, path = nil)
|
@@ -93,5 +123,29 @@ module Handlebarsjs
|
|
93
123
|
path: path
|
94
124
|
}
|
95
125
|
end
|
126
|
+
|
127
|
+
# This context should be on handlebars, not snapshot (I THINK)
|
128
|
+
def attach_ruby(context, helper_entry)
|
129
|
+
name = helper_entry[:name]
|
130
|
+
callback = helper_entry[:callback]
|
131
|
+
|
132
|
+
context.attach("ruby_#{name}", callback)
|
133
|
+
end
|
134
|
+
|
135
|
+
def eval_register_helper(context, helper_entry)
|
136
|
+
script = if helper_entry[:safe]
|
137
|
+
Handlebarsjs::Handlebars.register_safe_string_helper_script(helper_entry[:name], helper_entry[:parameters])
|
138
|
+
else
|
139
|
+
Handlebarsjs::Handlebars.register_helper_script(helper_entry[:name])
|
140
|
+
end
|
141
|
+
|
142
|
+
context.eval(script)
|
143
|
+
end
|
144
|
+
|
145
|
+
def build_register_helper_script(helper_entry)
|
146
|
+
return Handlebarsjs::Handlebars.register_safe_string_helper_script(helper_entry[:name], helper_entry[:parameters]) if helper_entry[:safe]
|
147
|
+
|
148
|
+
Handlebarsjs::Handlebars.register_helper_script(helper_entry[:name])
|
149
|
+
end
|
96
150
|
end
|
97
151
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Handlebarsjs
|
4
|
+
module Helpers
|
5
|
+
# Miscellaneous cmdlets
|
6
|
+
module Misc
|
7
|
+
# Safe: pass through the value with <> and single and double quotes left as is
|
8
|
+
class Safe < Handlebarsjs::BaseHelper
|
9
|
+
register_cmdlet(Cmdlet::Misc::Safe, safe: true, parameter_names: [:value])
|
10
|
+
|
11
|
+
def to_proc
|
12
|
+
->(value, _opts) { wrapper(cmdlet.call(value)) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -314,6 +314,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
314
314
|
logger: _logger2['default'],
|
315
315
|
log: _logger2['default'].log,
|
316
316
|
|
317
|
+
|
318
|
+
// Handlebars.registerHelper('encodeMyString',function(inputData){
|
319
|
+
// return new Handlebars.SafeString(inputData);
|
320
|
+
// });
|
321
|
+
// safeStringHelper: safeStringHelper(name, fn)
|
322
|
+
|
323
|
+
// How do I write a callback function to wrap a callback function in javascript
|
324
|
+
// registerSafeHelper: function registerSafeHelper(name, fn) {
|
325
|
+
// new_function: function(fn) {
|
326
|
+
// return function(context, options) {
|
327
|
+
// return new Handlebars.SafeString(fn(context, options)); "<hello />"
|
328
|
+
// };
|
329
|
+
// }
|
330
|
+
// registerHelper(name, new_function)
|
331
|
+
// },
|
332
|
+
|
333
|
+
|
317
334
|
registerHelper: function registerHelper(name, fn) {
|
318
335
|
if (_utils.toString.call(name) === objectType) {
|
319
336
|
if (fn) {
|
@@ -1,3 +1,12 @@
|
|
1
1
|
Handlebars.registerHelper('loud', function (input) {
|
2
2
|
return input.toUpperCase()
|
3
|
-
})
|
3
|
+
})
|
4
|
+
|
5
|
+
Handlebars.registerHelper('allow_html', function (some_html) {
|
6
|
+
return new Handlebars.SafeString(some_html);
|
7
|
+
})
|
8
|
+
|
9
|
+
// Handlebars.registerHelper('i_am_safe_xxx', function (some_html) {
|
10
|
+
// some_html = "doe some thing"
|
11
|
+
// return new Handlebars.SafeString(some_html);
|
12
|
+
// })
|
data/lib/handlebarsjs/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "handlebarsjs",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.0",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "handlebarsjs",
|
9
|
-
"version": "0.
|
9
|
+
"version": "0.8.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
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.
|
4
|
+
version: 0.8.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-
|
11
|
+
date: 2022-07-16 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,13 +122,13 @@ 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
|
132
128
|
- lib/handlebarsjs/helpers/inflection/pluralize_number.rb
|
133
129
|
- lib/handlebarsjs/helpers/inflection/pluralize_number_word.rb
|
134
130
|
- lib/handlebarsjs/helpers/inflection/singularize.rb
|
131
|
+
- lib/handlebarsjs/helpers/misc/safe.rb
|
135
132
|
- lib/handlebarsjs/javascript.rb
|
136
133
|
- lib/handlebarsjs/javascript/handlebars-4.7.7.js
|
137
134
|
- lib/handlebarsjs/javascript/handlebars-api.js
|
@@ -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
|