sheng 0.7.0 → 0.7.1

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
  SHA1:
3
- metadata.gz: 0ec8f23105c305c72f5b53353159af9e06270a9d
4
- data.tar.gz: fa8ab0fb420ce05a35bbd618cf3917ba2db37079
3
+ metadata.gz: 46b56f32284c6a90b179ca60a00159cd68c7252d
4
+ data.tar.gz: 7eba0edec4853b14d650d1473b3151ddfd78bbe6
5
5
  SHA512:
6
- metadata.gz: 2bf7eba12b6dafaa74b3f124af9c4a0067ac27881dbcfa1c9d53534f75743315de50a55f07254097447931d41a2e18ee6cab169d03fa07be5e2efcb2cc4f04f6
7
- data.tar.gz: ead41846b76e31006b09f52d5d7e83379e6daaf6e6d68fade166849dc3d524326c8361295a0d60c3465200d54bdd11900aae07e32d98c49fa5ce8b216dc217f7
6
+ metadata.gz: 357d2e721be53f889ff3fa1562a36064ac9cf17e16b8f7e61a3d34d1782eda453784e6b692ab3be63f710626579565db5f48110b80f6962dc84f352599b8ad9d
7
+ data.tar.gz: 11efa2474456149a2f429a9e034bd6c4990d29165df917902c05dd5c8c1087cb1b8f316175c9f1313984de8a84ca4c67009dd4139cfc6aa233506942e62f817b
@@ -7,6 +7,8 @@ module Sheng
7
7
 
8
8
  def filter(value)
9
9
  return value unless Sheng::Support.is_numeric?(value)
10
+ value = Sheng::Support.typecast_numeric(value)
11
+
10
12
  integer, fractional = ("%00.2f" % value).split(".")
11
13
 
12
14
  if integer.length > 3
@@ -1,3 +1,3 @@
1
1
  module Sheng
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "sheng"
8
8
  spec.version = Sheng::VERSION
9
9
  spec.authors = ["Ravi Gadad", "Maher Hawash"]
10
- spec.email = ["ravi@renewfund.com", "hungryed6@gmail.com"]
10
+ spec.email = ["ravi@renewfund.com"]
11
11
  spec.description = "A Ruby gem for data merging Word documents."
12
12
  spec.summary = "A Ruby gem for data merging Word documents, using native MergeFields as placeholders in templates, and a Ruby hash as the data set for substitution."
13
13
  spec.homepage = ""
@@ -4,7 +4,9 @@ describe Sheng::Filters::CurrencyFormattingFilter do
4
4
  test_cases = [
5
5
  { method: :currency, input: 3452341.826, output: "3,452,341.83" },
6
6
  { method: :currency, input: "1645.3", output: "1,645.30" },
7
+ { method: :currency, input: "1,645.3", arguments: ["-$"], output: "-$1,645.30" },
7
8
  { method: :currency, input: 192.3, output: "192.30" },
9
+ { method: :currency, input: "19.3", output: "19.30" },
8
10
  { method: :currency, arguments: ["¥"], input: "12351.184", output: "¥12,351.18" }
9
11
  ]
10
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Gadad
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-14 00:00:00.000000000 Z
12
+ date: 2016-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -154,7 +154,6 @@ dependencies:
154
154
  description: A Ruby gem for data merging Word documents.
155
155
  email:
156
156
  - ravi@renewfund.com
157
- - hungryed6@gmail.com
158
157
  executables: []
159
158
  extensions: []
160
159
  extra_rdoc_files: []