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 +4 -4
- data/ext/date/date_core.c +15 -14
- data/ext/date/date_parse.c +3 -0
- data/ext/date/date_strptime.c +3 -0
- data/ext/date/prereq.mk +1 -1
- data/ext/date/zonetab.h +627 -625
- data/ext/date/zonetab.list +5 -2
- data/lib/date.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 663deb4b7503aa59db5242f38e54b0e00072a41715555d584171f1b49423d898
|
4
|
+
data.tar.gz: 7c59321afa979e6823fe7e5ee93dd4a558822a4b9fb2406d8c0c440a7db3d869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(...)
|
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
|
-
*
|
6336
|
-
*
|
6337
|
-
*
|
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
|
-
|
8968
|
-
get_d1b(
|
8965
|
+
self = d_lite_gregorian(self);
|
8966
|
+
get_d1b(self);
|
8969
8967
|
adat = bdat;
|
8970
8968
|
}
|
8971
8969
|
|
8972
|
-
|
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
|
-
|
9469
|
+
rb_ary_freeze(o);
|
9469
9470
|
return o;
|
9470
9471
|
}
|
9471
9472
|
|
data/ext/date/date_parse.c
CHANGED
@@ -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
|
|
data/ext/date/date_strptime.c
CHANGED