date 3.3.4 → 3.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c21f55b2cc18baf941cd4774c226c424d7f987bee9239e0b732a0d9fb4f0e6fd
4
- data.tar.gz: 2acbe62f992812810d0efd5f09801fcec3669d1ba4df7afc20b95a10a13093a9
3
+ metadata.gz: 663deb4b7503aa59db5242f38e54b0e00072a41715555d584171f1b49423d898
4
+ data.tar.gz: 7c59321afa979e6823fe7e5ee93dd4a558822a4b9fb2406d8c0c440a7db3d869
5
5
  SHA512:
6
- metadata.gz: 13082c47b2973af41fc9064501b16db82f900a3e8c8f4d470370f8f424cf89752e49193595329e37029007a5086d83725321f836efe949012f7df43cff26d401
7
- data.tar.gz: 1500c8d72b88fabb2645cbd67da24447f9a11be934a20cad3557b8b261bfa788e9a7d9f699891c1c93a39fd92c3427c9672d0d84815390b57337727d77665153
6
+ metadata.gz: 28d17ce123b257d3b5983104040709f96d6c0abeb5e431678e83a3e41148630857d96e130451fd6ecf77a3d9a19bd7dac08479ca3d5350c0157adfc009b4b48d
7
+ data.tar.gz: 6f1ae004dd42e1e566e59371009b128ada23a76fd2dafa0384cb50fffeb84be0791f1d1e06916eebd31c1708d9d4026bc987f94cc5bb5e895c9200bf7e7c1907
data/ext/date/date_core.c CHANGED
@@ -57,7 +57,7 @@ static VALUE sym_hour, sym_min, sym_sec, sym_sec_fraction, sym_zone;
57
57
  #define f_add3(x,y,z) f_add(f_add(x, y), z)
58
58
  #define f_sub3(x,y,z) f_sub(f_sub(x, y), z)
59
59
 
60
- #define f_frozen_ary(...) rb_obj_freeze(rb_ary_new3(__VA_ARGS__))
60
+ #define f_frozen_ary(...) rb_ary_freeze(rb_ary_new3(__VA_ARGS__))
61
61
 
62
62
  static VALUE date_initialize(int argc, VALUE *argv, VALUE self);
63
63
  static VALUE datetime_initialize(int argc, VALUE *argv, VALUE self);
@@ -4464,12 +4464,6 @@ check_limit(VALUE str, VALUE opt)
4464
4464
  {
4465
4465
  size_t slen, limit;
4466
4466
  if (NIL_P(str)) return;
4467
- if (SYMBOL_P(str)) {
4468
- rb_category_warn(RB_WARN_CATEGORY_DEPRECATED,
4469
- "The ability to parse Symbol is an unintentional bug and is deprecated");
4470
- str = rb_sym2str(str);
4471
- }
4472
-
4473
4467
  StringValue(str);
4474
4468
  slen = RSTRING_LEN(str);
4475
4469
  limit = get_limit(opt);
@@ -6332,9 +6326,11 @@ minus_dd(VALUE self, VALUE other)
6332
6326
  * call-seq:
6333
6327
  * d - other -> date or rational
6334
6328
  *
6335
- * Returns the difference between the two dates if the other is a date
6336
- * object. If the other is a numeric value, returns a date object
6337
- * pointing +other+ days before self. If the other is a fractional number,
6329
+ * If the other is a date object, returns a Rational
6330
+ * whose value is the difference between the two dates in days.
6331
+ * If the other is a numeric value, returns a date object
6332
+ * pointing +other+ days before self.
6333
+ * If the other is a fractional number,
6338
6334
  * assumes its precision is at most nanosecond.
6339
6335
  *
6340
6336
  * Date.new(2001,2,3) - 1 #=> #<Date: 2001-02-02 ...>
@@ -8961,18 +8957,22 @@ time_to_datetime(VALUE self)
8961
8957
  static VALUE
8962
8958
  date_to_time(VALUE self)
8963
8959
  {
8960
+ VALUE t;
8961
+
8964
8962
  get_d1a(self);
8965
8963
 
8966
8964
  if (m_julian_p(adat)) {
8967
- VALUE tmp = d_lite_gregorian(self);
8968
- get_d1b(tmp);
8965
+ self = d_lite_gregorian(self);
8966
+ get_d1b(self);
8969
8967
  adat = bdat;
8970
8968
  }
8971
8969
 
8972
- return f_local3(rb_cTime,
8970
+ t = f_local3(rb_cTime,
8973
8971
  m_real_year(adat),
8974
8972
  INT2FIX(m_mon(adat)),
8975
8973
  INT2FIX(m_mday(adat)));
8974
+ RB_GC_GUARD(self); /* may be the converted gregorian */
8975
+ return t;
8976
8976
  }
8977
8977
 
8978
8978
  /*
@@ -9061,6 +9061,7 @@ datetime_to_time(VALUE self)
9061
9061
  f_add(INT2FIX(m_sec(dat)),
9062
9062
  m_sf_in_sec(dat)),
9063
9063
  INT2FIX(m_of(dat)));
9064
+ RB_GC_GUARD(self); /* may be the converted gregorian */
9064
9065
  return t;
9065
9066
  }
9066
9067
  }
@@ -9465,7 +9466,7 @@ mk_ary_of_str(long len, const char *a[])
9465
9466
  }
9466
9467
  rb_ary_push(o, e);
9467
9468
  }
9468
- rb_obj_freeze(o);
9469
+ rb_ary_freeze(o);
9469
9470
  return o;
9470
9471
  }
9471
9472
 
@@ -7,6 +7,9 @@
7
7
  #include "ruby/re.h"
8
8
  #include <ctype.h>
9
9
 
10
+ #undef strncasecmp
11
+ #define strncasecmp STRNCASECMP
12
+
10
13
  RUBY_EXTERN VALUE rb_int_positive_pow(long x, unsigned long y);
11
14
  RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
12
15
 
@@ -7,6 +7,9 @@
7
7
  #include "ruby/re.h"
8
8
  #include <ctype.h>
9
9
 
10
+ #undef strncasecmp
11
+ #define strncasecmp STRNCASECMP
12
+
10
13
  static const char *day_names[] = {
11
14
  "Sunday", "Monday", "Tuesday", "Wednesday",
12
15
  "Thursday", "Friday", "Saturday",
data/ext/date/prereq.mk CHANGED
@@ -1,7 +1,7 @@
1
1
  .SUFFIXES: .list
2
2
 
3
3
  .list.h:
4
- gperf --ignore-case -C -c -P -p -j1 -i 1 -g -o -t -N $(*F) $< \
4
+ gperf --ignore-case -L ANSI-C -C -c -P -p -j1 -i 1 -g -o -t -N $(*F) $< \
5
5
  | sed -f $(top_srcdir)/tool/gperf.sed \
6
6
  > $(@F)
7
7