sanitizing_bigdecimal 0.0.1 → 0.0.2
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/README.md +2 -2
- data/lib/sanitizing_bigdecimal.rb +2 -1
- data/spec/unit/sanitizing_bigdecimal_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 119d261442f3f332ae48feeafae126ef1707f500
|
4
|
+
data.tar.gz: f2bf4826c9ca085ccf8247e5beb2138474249208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0ea9dd42abfe4ba5a551dc7917e0bdff3d64d89ec42b2525e368aeb97829aaebb3a46d46763fc6b657c4e69252378a541bb5411c35514ba0a8ec5daa4ea9605
|
7
|
+
data.tar.gz: 0c62ec02c34a8f92872eceef45b9da177e3c3f251b2f031e032d9f697903a7026478f4ad98ab92aa034ee986709a4076ba601d4fc07f3e9683d102749b7d34d8
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# SanitizingBigDecimal
|
2
2
|
|
3
3
|
Take user interface into BigDecimal without bugs
|
4
4
|
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
```ruby
|
22
22
|
user_input = "$3,000.23"
|
23
|
-
SanitizingBigDecimal
|
23
|
+
SanitizingBigDecimal(user_input)
|
24
24
|
#=> #<BigDecimal:bd78f60,'0.300023E4',9(18)>
|
25
25
|
```
|
26
26
|
|
@@ -8,4 +8,9 @@ describe SanitizingBigDecimal do
|
|
8
8
|
it "strips non-numeric characters (allows decimal point)" do
|
9
9
|
expect(SanitizingBigDecimal("$1,000.23")).to eq(BigDecimal("1000.23"))
|
10
10
|
end
|
11
|
+
|
12
|
+
it "returns what it's passed, if it is passed a BigDecimal" do
|
13
|
+
input = BigDecimal("1000.13")
|
14
|
+
expect(SanitizingBigDecimal(input)).to equal(input)
|
15
|
+
end
|
11
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanitizing_bigdecimal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Adams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.0.
|
94
|
+
rubygems_version: 2.0.2
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: This gem aims to solve various common problems around converting user input
|