dohutil 0.2.35 → 0.2.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/MIT-LICENSE +1 -1
- data/lib/dohutil/core_ext/bigdecimal.rb +7 -5
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f03cfa2550664f0eee00b17e22f92ceeef4b26347aae0b769620733dc22ed5df
|
4
|
+
data.tar.gz: 8be7c030fe500c4bd5c25aa5197a566f3c291299fa4400cb7de57dc7a9d9938a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45a7eb23f741eb5c3f679a79bca40920d85334b55cf3446a978ac324df81844f15381c55cbc95e6c34d90757ffaf70b2b721a677ea5d946c5e3ab518f9db43e3
|
7
|
+
data.tar.gz: cba3e36d2ebbb79cc7a1a0e4727f047412396669c243ce5ff1dcc951b1d7157e2c9927c105c1510af8e1ea543bc14a6d28e9b9581dcbfb0bad9cd6d9160470f3
|
data/MIT-LICENSE
CHANGED
@@ -2,7 +2,7 @@ require 'bigdecimal'
|
|
2
2
|
require 'bigdecimal/util'
|
3
3
|
|
4
4
|
class Integer
|
5
|
-
|
5
|
+
if !method_defined?(:to_d)
|
6
6
|
def to_d
|
7
7
|
BigDecimal(self)
|
8
8
|
end
|
@@ -10,7 +10,7 @@ class Integer
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class BigDecimal
|
13
|
-
|
13
|
+
if !method_defined?(:to_d)
|
14
14
|
def to_d
|
15
15
|
self
|
16
16
|
end
|
@@ -22,7 +22,7 @@ class BigDecimal
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_dig(digits_after_decimal = 2)
|
25
|
-
raise ArgumentError.new("digits_after_decimal must be >= 0")
|
25
|
+
raise ArgumentError.new("digits_after_decimal must be >= 0") if digits_after_decimal < 0
|
26
26
|
if nan? || infinite?
|
27
27
|
return '0' if digits_after_decimal == 0
|
28
28
|
return '0.' + ('0' * digits_after_decimal)
|
@@ -43,7 +43,9 @@ end
|
|
43
43
|
class NilClass
|
44
44
|
NIL_ZERO_BIGD = BigDecimal(0)
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
if !method_defined?(:to_d)
|
47
|
+
def to_d
|
48
|
+
NIL_ZERO_BIGD
|
49
|
+
end
|
48
50
|
end
|
49
51
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Kem Mason
|
7
|
+
- ATPSoft
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: dohroot
|
@@ -138,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
137
|
- !ruby/object:Gem::Version
|
139
138
|
version: '0'
|
140
139
|
requirements: []
|
141
|
-
|
142
|
-
rubygems_version: 2.6.13
|
140
|
+
rubygems_version: 3.1.3
|
143
141
|
signing_key:
|
144
142
|
specification_version: 4
|
145
143
|
summary: assorted tiny utilities
|