bigdecimal 1.4.2 → 1.4.3.pre.20190110
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/bigdecimal.gemspec +1 -1
- data/ext/bigdecimal/bigdecimal.c +26 -13
- data/lib/bigdecimal.rb +15 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20713bc60960a4a3a09cade6de0a9ac669a9f7e73c191ac21eea2febf4a951ca
|
4
|
+
data.tar.gz: 9224fe24f3e22de33964cb9398c5bbd6b2bb94693367f08731c6151ca2e1e55e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a62bfca25e44ca876a9a940be39969d358a1b8409cfb8ad0d1a927837ace817f5b3248967c6d3be8fca46837392c28b43a590bd58276c0a81e22159e395721e
|
7
|
+
data.tar.gz: ba6050a71d377a969fb1c79db892965871ff35f4f69a7f8c91eb67f81825c262035f2b119121582a3a791ca1cb86a12a7f2c4b9bc6bb598e815d289c6a26ed19
|
data/bigdecimal.gemspec
CHANGED
data/ext/bigdecimal/bigdecimal.c
CHANGED
@@ -2573,7 +2573,7 @@ opts_exception_p(VALUE opts)
|
|
2573
2573
|
}
|
2574
2574
|
|
2575
2575
|
static Real *
|
2576
|
-
|
2576
|
+
VpNewVarArgs(int argc, VALUE *argv)
|
2577
2577
|
{
|
2578
2578
|
size_t mf;
|
2579
2579
|
VALUE opts = Qnil;
|
@@ -2667,6 +2667,23 @@ BigDecimal_new(int argc, VALUE *argv)
|
|
2667
2667
|
return VpAlloc(mf, RSTRING_PTR(iniValue), 1, exc);
|
2668
2668
|
}
|
2669
2669
|
|
2670
|
+
static VALUE
|
2671
|
+
BigDecimal_new(int argc, VALUE *argv, VALUE klass)
|
2672
|
+
{
|
2673
|
+
ENTER(1);
|
2674
|
+
Real *pv;
|
2675
|
+
VALUE obj;
|
2676
|
+
|
2677
|
+
obj = TypedData_Wrap_Struct(klass, &BigDecimal_data_type, 0);
|
2678
|
+
pv = VpNewVarArgs(argc, argv);
|
2679
|
+
if (pv == NULL) return Qnil;
|
2680
|
+
SAVE(pv);
|
2681
|
+
if (ToValue(pv)) pv = VpCopy(NULL, pv);
|
2682
|
+
RTYPEDDATA_DATA(obj) = pv;
|
2683
|
+
RB_OBJ_FREEZE(obj);
|
2684
|
+
return pv->obj = obj;
|
2685
|
+
}
|
2686
|
+
|
2670
2687
|
/* call-seq:
|
2671
2688
|
* BigDecimal(initial, digits, exception: true)
|
2672
2689
|
*
|
@@ -2706,18 +2723,14 @@ BigDecimal_new(int argc, VALUE *argv)
|
|
2706
2723
|
static VALUE
|
2707
2724
|
f_BigDecimal(int argc, VALUE *argv, VALUE self)
|
2708
2725
|
{
|
2709
|
-
|
2710
|
-
|
2711
|
-
VALUE obj;
|
2726
|
+
return BigDecimal_new(argc, argv, rb_cBigDecimal);
|
2727
|
+
}
|
2712
2728
|
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
RTYPEDDATA_DATA(obj) = pv;
|
2719
|
-
RB_OBJ_FREEZE(obj);
|
2720
|
-
return pv->obj = obj;
|
2729
|
+
/* DEPRECATED: BigDecimal.new() */
|
2730
|
+
static VALUE
|
2731
|
+
BigDecimal_s_new(int argc, VALUE *argv, VALUE klass)
|
2732
|
+
{
|
2733
|
+
return BigDecimal_new(argc, argv, klass);
|
2721
2734
|
}
|
2722
2735
|
|
2723
2736
|
/* call-seq:
|
@@ -3299,7 +3312,7 @@ Init_bigdecimal(void)
|
|
3299
3312
|
|
3300
3313
|
/* Class methods */
|
3301
3314
|
rb_undef_method(CLASS_OF(rb_cBigDecimal), "allocate");
|
3302
|
-
|
3315
|
+
rb_define_singleton_method(rb_cBigDecimal, "new", BigDecimal_s_new, -1);
|
3303
3316
|
rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1);
|
3304
3317
|
rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1);
|
3305
3318
|
rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0);
|
data/lib/bigdecimal.rb
CHANGED
@@ -4,7 +4,19 @@ rescue LoadError
|
|
4
4
|
require 'bigdecimal.so'
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
class BigDecimal
|
8
|
+
module Deprecation
|
9
|
+
def new(*args, **kwargs)
|
10
|
+
warn "BigDecimal.new is deprecated; use BigDecimal() method instead.", uplevel: 1
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
prepend Deprecation
|
17
|
+
|
18
|
+
def inherited(subclass)
|
19
|
+
warn "subclassing BigDecimal will be disallowed after bigdecimal version 2.0", uplevel: 1
|
20
|
+
end
|
21
|
+
end
|
10
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigdecimal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3.pre.20190110
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Murata
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -124,9 +124,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: 2.3.0
|
125
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - "
|
127
|
+
- - ">"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
129
|
+
version: 1.3.1
|
130
130
|
requirements: []
|
131
131
|
rubygems_version: 3.0.1
|
132
132
|
signing_key:
|