handlebars-helpers 0.0.80 → 0.0.86
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/Rakefile +14 -0
- data/lib/handlebars/helpers.rb +7 -0
- data/lib/handlebars/helpers/code_javascript/as_javascript.rb +2 -2
- data/lib/handlebars/helpers/inflection/pluralize.rb +2 -0
- data/lib/handlebars/helpers/inflection/singularize.rb +2 -0
- data/lib/handlebars/helpers/string_formatting/padl.rb +1 -1
- data/lib/handlebars/helpers/string_formatting/padr.rb +1 -1
- data/lib/handlebars/helpers/string_formatting/snake.rb +2 -2
- data/lib/handlebars/helpers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65fcf8d27d477ab4f2e9a56a9a60a881d5aee92e476902de748a0648e55063f3
|
4
|
+
data.tar.gz: 3330aff0afbf58c65ebb1a9347c7cbe44fe3093be3100997b2d630781c1c1033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0152226f0ec8a081e79ac48631ba02354e88f5700514ad68c8d703b96e2f611378ce1dc7c55bba05b86342e122bf0e1a7d1d9e38829ae8f6839c7511660bd8eb
|
7
|
+
data.tar.gz: 972b08bab28fe0d500e8f8539b038d3fce63809d47c52df140c36b62f1ed59c779795750b101f5ac28a41c31312dcce224757e962f1dcf1b0833a27230fefbe8
|
data/Rakefile
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
GEM_NAME = 'handlebars-helpers'
|
4
|
+
|
3
5
|
require 'bundler/gem_tasks'
|
4
6
|
require 'rspec/core/rake_task'
|
7
|
+
require 'handlebars/helpers/version'
|
5
8
|
|
6
9
|
RSpec::Core::RakeTask.new(:spec)
|
7
10
|
|
@@ -14,4 +17,15 @@ Rake::ExtensionTask.new('handlebars_helpers') do |ext|
|
|
14
17
|
ext.lib_dir = 'lib/handlebars_helpers'
|
15
18
|
end
|
16
19
|
|
20
|
+
desc 'Publish the gem to RubyGems.org'
|
21
|
+
task :publish do
|
22
|
+
system 'gem build'
|
23
|
+
system "gem push #{GEM_NAME}-#{Handlebars::Helpers::VERSION}.gem"
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Remove old *.gem files'
|
27
|
+
task :clean do
|
28
|
+
system 'rm *.gem'
|
29
|
+
end
|
30
|
+
|
17
31
|
task default: %i[clobber compile spec]
|
data/lib/handlebars/helpers.rb
CHANGED
@@ -14,3 +14,10 @@ module Handlebars
|
|
14
14
|
# Your code goes here...
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
if ENV['KLUE_DEBUG']&.to_s&.downcase == 'true'
|
19
|
+
namespace = 'Handlebars::Helpers::Version'
|
20
|
+
file_path = $LOADED_FEATURES.find { |f| f.include?('handlebars/helpers/version') }
|
21
|
+
version = Handlebars::Helpers::VERSION.ljust(9)
|
22
|
+
puts "#{namespace.ljust(35)} : #{version.ljust(9)} : #{file_path}"
|
23
|
+
end
|
@@ -41,8 +41,8 @@ module Handlebars
|
|
41
41
|
proc do |_context, value, format|
|
42
42
|
# Handle optional: format
|
43
43
|
format = nil if format.is_a?(V8::Object)
|
44
|
-
|
45
|
-
|
44
|
+
format = format.to_sym if format.is_a?(String)
|
45
|
+
|
46
46
|
wrapper(parse(value, format))
|
47
47
|
end
|
48
48
|
end
|
@@ -40,7 +40,7 @@ module Handlebars
|
|
40
40
|
count = Handlebars::Helpers.configuration.padl_count if count.nil?
|
41
41
|
count = count.to_i if count.is_a?(String)
|
42
42
|
char = Handlebars::Helpers.configuration.padl_char if char.nil?
|
43
|
-
value.rjust(count, char)
|
43
|
+
value.to_s.rjust(count, char)
|
44
44
|
end
|
45
45
|
|
46
46
|
def handlebars_helper
|
@@ -41,7 +41,7 @@ module Handlebars
|
|
41
41
|
count = Handlebars::Helpers.configuration.padr_count if count.nil?
|
42
42
|
count = count.to_i if count.is_a?(String)
|
43
43
|
char = Handlebars::Helpers.configuration.padr_char if char.nil?
|
44
|
-
value.ljust(count, char)
|
44
|
+
value.to_s.ljust(count, char)
|
45
45
|
end
|
46
46
|
|
47
47
|
def handlebars_helper
|
@@ -21,11 +21,11 @@ module Handlebars
|
|
21
21
|
#
|
22
22
|
# puts Snake.new.parse('the quick brown fox 99')
|
23
23
|
#
|
24
|
-
#
|
24
|
+
# the_quick_brown_fox99
|
25
25
|
#
|
26
26
|
# @return [String] value converted to snake case
|
27
27
|
def parse(value)
|
28
|
-
tokenizer.parse(value, separator: '_')
|
28
|
+
tokenizer.parse(value, separator: '_', forced_separator: true)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: handlebars-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.86
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|