bigdecimal 1.4.2 → 1.4.3.pre.20190110

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
  SHA256:
3
- metadata.gz: 5ef8a298cdf9271292d1e8a98edb10b179fe4250c0e6c10eaaae68afe0a95659
4
- data.tar.gz: 0a75b502a86f3b31cf2a01a2bc49b2195c78e202a65ff8af1d515fff4a44b914
3
+ metadata.gz: 20713bc60960a4a3a09cade6de0a9ac669a9f7e73c191ac21eea2febf4a951ca
4
+ data.tar.gz: 9224fe24f3e22de33964cb9398c5bbd6b2bb94693367f08731c6151ca2e1e55e
5
5
  SHA512:
6
- metadata.gz: 1a942a904c859a53582239390da0a51bcee719c21efb4c567023f27faa73d7b4c737e8b0246f3dbaa2ffc3ffa4546a3bdd04ac7cfbbc7e940115afd2ad0df46d
7
- data.tar.gz: d632e8b92d656417ba71c35e7892607615c18bde828b0f685db506795bbd4811dd5c1211b08d9c240a2f2ab8f04b808f7514bd462243b7c7b668a9723ca379fd
6
+ metadata.gz: 9a62bfca25e44ca876a9a940be39969d358a1b8409cfb8ad0d1a927837ace817f5b3248967c6d3be8fca46837392c28b43a590bd58276c0a81e22159e395721e
7
+ data.tar.gz: ba6050a71d377a969fb1c79db892965871ff35f4f69a7f8c91eb67f81825c262035f2b119121582a3a791ca1cb86a12a7f2c4b9bc6bb598e815d289c6a26ed19
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- bigdecimal_version = '1.4.2'
3
+ bigdecimal_version = '1.4.3.pre.20190110'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "bigdecimal"
@@ -2573,7 +2573,7 @@ opts_exception_p(VALUE opts)
2573
2573
  }
2574
2574
 
2575
2575
  static Real *
2576
- BigDecimal_new(int argc, VALUE *argv)
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
- ENTER(1);
2710
- Real *pv;
2711
- VALUE obj;
2726
+ return BigDecimal_new(argc, argv, rb_cBigDecimal);
2727
+ }
2712
2728
 
2713
- obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, 0);
2714
- pv = BigDecimal_new(argc, argv);
2715
- if (pv == NULL) return Qnil;
2716
- SAVE(pv);
2717
- if (ToValue(pv)) pv = VpCopy(NULL, pv);
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
- rb_undef_method(CLASS_OF(rb_cBigDecimal), "new");
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);
@@ -4,7 +4,19 @@ rescue LoadError
4
4
  require 'bigdecimal.so'
5
5
  end
6
6
 
7
- def BigDecimal.new(*args, **kwargs)
8
- warn "BigDecimal.new is deprecated; use BigDecimal() method instead.", uplevel: 1
9
- BigDecimal(*args, **kwargs)
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.2
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: 2018-12-26 00:00:00.000000000 Z
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: '0'
129
+ version: 1.3.1
130
130
  requirements: []
131
131
  rubygems_version: 3.0.1
132
132
  signing_key: