handlebars-helpers 0.0.81 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -0
- data/lib/handlebars/helpers.rb +7 -0
- data/lib/handlebars/helpers/comparison/eq.rb +3 -0
- data/lib/handlebars/helpers/comparison/ne.rb +3 -0
- 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: cae41fcd90830d3b8eddd6537fe99d83bd592a84f6866b445dedd7846acf8f58
|
4
|
+
data.tar.gz: 7b307f0b61b718278aea66ffa70a58f7f8629b94444b286bb15cb8251087381d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e30e3f6473c1d3fc8ebf18b7072689d9dfdbf63d52c932b0e6eeea2d01d2e45a2d3852fd22066bfe2133fe89264cf194ca35fab009de75c0842d08787a442a3a
|
7
|
+
data.tar.gz: 77fed0fb25c9199f446d86be78b768384dd0fc05c0f28cd64a306ec9e28ac3667fb19c792ae34468310c347b64ba51134f095d5769ff0a6eec800115079dd20f
|
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
|
@@ -23,6 +23,9 @@ module Handlebars
|
|
23
23
|
# @param [String] rhs - right hand side value
|
24
24
|
# @return [String] truthy value if left hand side equals right hand side
|
25
25
|
def parse(lhs, rhs)
|
26
|
+
lhs = lhs.to_s if lhs.is_a?(Symbol)
|
27
|
+
rhs = rhs.to_s if rhs.is_a?(Symbol)
|
28
|
+
|
26
29
|
lhs == rhs
|
27
30
|
end
|
28
31
|
|
@@ -23,6 +23,9 @@ module Handlebars
|
|
23
23
|
# @param [String] rhs - right hand side value
|
24
24
|
# @return [String] truthy value if left hand side is NOT equal to right hand side
|
25
25
|
def parse(lhs, rhs)
|
26
|
+
lhs = lhs.to_s if lhs.is_a?(Symbol)
|
27
|
+
rhs = rhs.to_s if rhs.is_a?(Symbol)
|
28
|
+
|
26
29
|
lhs != rhs
|
27
30
|
end
|
28
31
|
|
@@ -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.87
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|