dohutil 0.2.22 → 0.2.23

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: 155fa31234d015b8cf53f9387291301ab3f94924
4
- data.tar.gz: ebd7365a1be071cc1e182955d9f6ea1cb0023f6f
3
+ metadata.gz: 918b2aecbcda649a901f0adb7abd3760c6dcae86
4
+ data.tar.gz: c89ad4ae8fd1baa1ef97d336ed8d3f6e9d034bd6
5
5
  SHA512:
6
- metadata.gz: 90412525f9590864197a27f57e93a352f4ac1728658e821de5dd8bc36d8ae3abd2ea5eda14f7683c5a420f0077e93a47ea5aa32703eac0d884b36d780e1a9aae
7
- data.tar.gz: 64d44cb9dd7af9e5f1e1bf13898fa9ae8809a10c1b02733859e689337a514bcdbba3bb4ab2e1c70e499636e5595b46b0278fc896e3b6d830ab49f8f38b05b2ac
6
+ metadata.gz: b5ce1e3175b00e54f2a4ba26e869fdd76ad759a382962057976ab1d84455970b8d5c3f2e1806b298c28af6858e13a475b55b4c9dfb29d1355349e8f401d9d874
7
+ data.tar.gz: 8b8e3e219a39b0a74153a441748d88227668a6d615af86dc77a60c82db62a0d869806864cedd020a1d2afe46772d9f70c4c55079db92e39790a3894e7c04daaa
@@ -4,7 +4,7 @@ require 'bigdecimal/util'
4
4
  class Integer
5
5
  unless method_defined?(:to_d)
6
6
  def to_d
7
- to_s.to_d
7
+ BigDecimal(self)
8
8
  end
9
9
  end
10
10
  end
@@ -41,7 +41,7 @@ class BigDecimal
41
41
  end
42
42
 
43
43
  class NilClass
44
- NIL_ZERO_BIGD = BigDecimal('0')
44
+ NIL_ZERO_BIGD = BigDecimal(0)
45
45
 
46
46
  def to_d
47
47
  NIL_ZERO_BIGD
@@ -28,6 +28,10 @@ def clear_current_date
28
28
  @current_date_stack.clear
29
29
  end
30
30
 
31
+ def current_date_stack
32
+ @current_date_stack
33
+ end
34
+
31
35
  def date_as_start_of_day(date_obj, &block)
32
36
  date_as(DateTime.new(date_obj.year, date_obj.month, date_obj.day, 0, 0, 0), &block)
33
37
  end
@@ -3,6 +3,10 @@ require 'dohutil/core_ext/bigdecimal'
3
3
  module Doh
4
4
 
5
5
  class Test_core_ext_bigdecimal < DohTest::TestGroup
6
+ def test_integer_to_d
7
+ assert_equal(BigDecimal(1), 1.to_d)
8
+ end
9
+
6
10
  def test_to_dig_valid
7
11
  assert_equal('0.00', BigDecimal('0').to_dig)
8
12
  assert_equal('1.00', BigDecimal('1').to_dig)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.22
4
+ version: 0.2.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani Mason
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-05 00:00:00.000000000 Z
12
+ date: 2015-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dohroot