handlebars-helpers 0.0.80 → 0.0.86

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: 39509c73f11207c3e1d83f13c505597b78e5a168d724e5d71295f95d1ec48fbc
4
- data.tar.gz: 7e185664a22428731c2512b6a576d82784ae0f16f218fe22b34117639f7475aa
3
+ metadata.gz: 65fcf8d27d477ab4f2e9a56a9a60a881d5aee92e476902de748a0648e55063f3
4
+ data.tar.gz: 3330aff0afbf58c65ebb1a9347c7cbe44fe3093be3100997b2d630781c1c1033
5
5
  SHA512:
6
- metadata.gz: b285b313b078c81cbd76e5b68fb43c6c7ed2f0c81e39dd3b18adb623d4629ab7396cf2a068cc51fe3380c5a26a4cd85856fd1ba81ae6692409a3add7699cabac
7
- data.tar.gz: 7b89009b0db7dae0e635fa09d0f7b362bd15b17850db9548a07b891784bb11f0f3fcd6da703347d82473f27187ff8c765c7a491d783283c64ce3eb79ad41bb70
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]
@@ -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
- # Handle optional: value
45
- # value = nil if value.is_a?(V8::Object)
44
+ format = format.to_sym if format.is_a?(String)
45
+
46
46
  wrapper(parse(value, format))
47
47
  end
48
48
  end
@@ -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.80'
5
+ VERSION = '0.0.86'
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.80
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-03-05 00:00:00.000000000 Z
11
+ date: 2021-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport