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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d83a1d35d176cf5af7dc32206a7284fd49592daaf4b9d180f71d894f8ac270e2
4
- data.tar.gz: d9dd469c0a6a55266f0783d656b905432c8d81ce0ce8f56b8818f421fae887e6
3
+ metadata.gz: cae41fcd90830d3b8eddd6537fe99d83bd592a84f6866b445dedd7846acf8f58
4
+ data.tar.gz: 7b307f0b61b718278aea66ffa70a58f7f8629b94444b286bb15cb8251087381d
5
5
  SHA512:
6
- metadata.gz: '02066321193e16b5e17dedc77f537cd364c7ccd596ed24aa57a7a4df4819d0818303e5a5a8e236ea35ed2c48186f7ba862db7ea26a540e88a810c013ea78a700'
7
- data.tar.gz: fbe2b160cdc4f3925e507c06cc2f8c43253baebf6a6314c85a806c7f649bee73198b974220ba854cd83e6a7ec262c970ecc8cee78a58faf6a906bf9e03b4671e
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]
@@ -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
 
@@ -28,6 +28,8 @@ module Handlebars
28
28
  def parse(value)
29
29
  return '' if value.nil?
30
30
 
31
+ value = value.to_s if value.is_a?(Symbol)
32
+
31
33
  value.pluralize
32
34
  end
33
35
  end
@@ -27,6 +27,8 @@ module Handlebars
27
27
  def parse(value)
28
28
  return '' if value.nil?
29
29
 
30
+ value = value.to_s if value.is_a?(Symbol)
31
+
30
32
  value.singularize
31
33
  end
32
34
  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
- # the-quick-brown-fox99
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Handlebars
4
4
  module Helpers
5
- VERSION = '0.0.81'
5
+ VERSION = '0.0.87'
6
6
  end
7
7
  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.81
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-03-05 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport