date 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/date/date_core.c +43 -49
- data/ext/date/extconf.rb +1 -0
- data/lib/date.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b82de0c3b7d4685d8aa478af5ce4d919808d79d83b71012b0f61052c37a1506
|
4
|
+
data.tar.gz: 6a1adeb0b3d43f3afdc9edb06c1b2bfd081f726e3b91dff9d5d482e77cf87d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69bc90e06d9f020e5c391732c6b95c8fabe8abe705be5760b5f303980b90ffda96ae55c0ad837a23c8c6701b63783a0a7c16bd2e13f82f7903c1c47089312645
|
7
|
+
data.tar.gz: 7c0aff9c2c9a43f3ac6b1f53a9530805792c7941c45074f5bb58cb90b24890efc641b374cbee7fd36ac8124426a748da92a67d148bb07329b62a90f14bfb9194
|
data/ext/date/date_core.c
CHANGED
@@ -248,6 +248,11 @@ f_negative_p(VALUE x)
|
|
248
248
|
#define date_sg_t double
|
249
249
|
#endif
|
250
250
|
|
251
|
+
#define JULIAN_EPOCH_DATE "-4712-01-01"
|
252
|
+
#define JULIAN_EPOCH_DATETIME JULIAN_EPOCH_DATE "T00:00:00+00:00"
|
253
|
+
#define JULIAN_EPOCH_DATETIME_RFC3339 "Mon, 1 Jan -4712 00:00:00 +0000"
|
254
|
+
#define JULIAN_EPOCH_DATETIME_HTTPDATE "Mon, 01 Jan -4712 00:00:00 GMT"
|
255
|
+
|
251
256
|
/* A set of nth, jd, df and sf denote ajd + 1/2. Each ajd begin at
|
252
257
|
* noon of GMT (assume equal to UTC). However, this begins at
|
253
258
|
* midnight.
|
@@ -4425,7 +4430,7 @@ date_s_strptime(int argc, VALUE *argv, VALUE klass)
|
|
4425
4430
|
|
4426
4431
|
switch (argc) {
|
4427
4432
|
case 0:
|
4428
|
-
str = rb_str_new2(
|
4433
|
+
str = rb_str_new2(JULIAN_EPOCH_DATE);
|
4429
4434
|
case 1:
|
4430
4435
|
fmt = rb_str_new2("%F");
|
4431
4436
|
case 2:
|
@@ -4478,8 +4483,7 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
|
|
4478
4483
|
{
|
4479
4484
|
VALUE vstr, vcomp, hash, opt;
|
4480
4485
|
|
4481
|
-
rb_scan_args(argc, argv, "11:", &vstr, &vcomp, &opt);
|
4482
|
-
if (!NIL_P(opt)) argc--;
|
4486
|
+
argc = rb_scan_args(argc, argv, "11:", &vstr, &vcomp, &opt);
|
4483
4487
|
check_limit(vstr, opt);
|
4484
4488
|
StringValue(vstr);
|
4485
4489
|
if (!rb_enc_str_asciicompat_p(vstr))
|
@@ -4566,12 +4570,11 @@ date_s_parse(int argc, VALUE *argv, VALUE klass)
|
|
4566
4570
|
{
|
4567
4571
|
VALUE str, comp, sg, opt;
|
4568
4572
|
|
4569
|
-
rb_scan_args(argc, argv, "03:", &str, &comp, &sg, &opt);
|
4570
|
-
if (!NIL_P(opt)) argc--;
|
4573
|
+
argc = rb_scan_args(argc, argv, "03:", &str, &comp, &sg, &opt);
|
4571
4574
|
|
4572
4575
|
switch (argc) {
|
4573
4576
|
case 0:
|
4574
|
-
str = rb_str_new2(
|
4577
|
+
str = rb_str_new2(JULIAN_EPOCH_DATE);
|
4575
4578
|
case 1:
|
4576
4579
|
comp = Qtrue;
|
4577
4580
|
case 2:
|
@@ -4646,12 +4649,11 @@ date_s_iso8601(int argc, VALUE *argv, VALUE klass)
|
|
4646
4649
|
{
|
4647
4650
|
VALUE str, sg, opt;
|
4648
4651
|
|
4649
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4650
|
-
if (!NIL_P(opt)) argc--;
|
4652
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4651
4653
|
|
4652
4654
|
switch (argc) {
|
4653
4655
|
case 0:
|
4654
|
-
str = rb_str_new2(
|
4656
|
+
str = rb_str_new2(JULIAN_EPOCH_DATE);
|
4655
4657
|
case 1:
|
4656
4658
|
sg = INT2FIX(DEFAULT_SG);
|
4657
4659
|
}
|
@@ -4717,12 +4719,11 @@ date_s_rfc3339(int argc, VALUE *argv, VALUE klass)
|
|
4717
4719
|
{
|
4718
4720
|
VALUE str, sg, opt;
|
4719
4721
|
|
4720
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4721
|
-
if (!NIL_P(opt)) argc--;
|
4722
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4722
4723
|
|
4723
4724
|
switch (argc) {
|
4724
4725
|
case 0:
|
4725
|
-
str = rb_str_new2(
|
4726
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
4726
4727
|
case 1:
|
4727
4728
|
sg = INT2FIX(DEFAULT_SG);
|
4728
4729
|
}
|
@@ -4786,12 +4787,11 @@ date_s_xmlschema(int argc, VALUE *argv, VALUE klass)
|
|
4786
4787
|
{
|
4787
4788
|
VALUE str, sg, opt;
|
4788
4789
|
|
4789
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4790
|
-
if (!NIL_P(opt)) argc--;
|
4790
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4791
4791
|
|
4792
4792
|
switch (argc) {
|
4793
4793
|
case 0:
|
4794
|
-
str = rb_str_new2(
|
4794
|
+
str = rb_str_new2(JULIAN_EPOCH_DATE);
|
4795
4795
|
case 1:
|
4796
4796
|
sg = INT2FIX(DEFAULT_SG);
|
4797
4797
|
}
|
@@ -4857,11 +4857,11 @@ date_s_rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
4857
4857
|
{
|
4858
4858
|
VALUE str, sg, opt;
|
4859
4859
|
|
4860
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4860
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4861
4861
|
|
4862
4862
|
switch (argc) {
|
4863
4863
|
case 0:
|
4864
|
-
str = rb_str_new2(
|
4864
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME_RFC3339);
|
4865
4865
|
case 1:
|
4866
4866
|
sg = INT2FIX(DEFAULT_SG);
|
4867
4867
|
}
|
@@ -4925,11 +4925,11 @@ date_s_httpdate(int argc, VALUE *argv, VALUE klass)
|
|
4925
4925
|
{
|
4926
4926
|
VALUE str, sg, opt;
|
4927
4927
|
|
4928
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4928
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
4929
4929
|
|
4930
4930
|
switch (argc) {
|
4931
4931
|
case 0:
|
4932
|
-
str = rb_str_new2(
|
4932
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME_HTTPDATE);
|
4933
4933
|
case 1:
|
4934
4934
|
sg = INT2FIX(DEFAULT_SG);
|
4935
4935
|
}
|
@@ -4997,12 +4997,11 @@ date_s_jisx0301(int argc, VALUE *argv, VALUE klass)
|
|
4997
4997
|
{
|
4998
4998
|
VALUE str, sg, opt;
|
4999
4999
|
|
5000
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
5001
|
-
if (!NIL_P(opt)) argc--;
|
5000
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
5002
5001
|
|
5003
5002
|
switch (argc) {
|
5004
5003
|
case 0:
|
5005
|
-
str = rb_str_new2(
|
5004
|
+
str = rb_str_new2(JULIAN_EPOCH_DATE);
|
5006
5005
|
case 1:
|
5007
5006
|
sg = INT2FIX(DEFAULT_SG);
|
5008
5007
|
}
|
@@ -8375,7 +8374,7 @@ datetime_s_strptime(int argc, VALUE *argv, VALUE klass)
|
|
8375
8374
|
|
8376
8375
|
switch (argc) {
|
8377
8376
|
case 0:
|
8378
|
-
str = rb_str_new2(
|
8377
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8379
8378
|
case 1:
|
8380
8379
|
fmt = rb_str_new2("%FT%T%z");
|
8381
8380
|
case 2:
|
@@ -8423,12 +8422,11 @@ datetime_s_parse(int argc, VALUE *argv, VALUE klass)
|
|
8423
8422
|
{
|
8424
8423
|
VALUE str, comp, sg, opt;
|
8425
8424
|
|
8426
|
-
rb_scan_args(argc, argv, "03:", &str, &comp, &sg, &opt);
|
8427
|
-
if (!NIL_P(opt)) argc--;
|
8425
|
+
argc = rb_scan_args(argc, argv, "03:", &str, &comp, &sg, &opt);
|
8428
8426
|
|
8429
8427
|
switch (argc) {
|
8430
8428
|
case 0:
|
8431
|
-
str = rb_str_new2(
|
8429
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8432
8430
|
case 1:
|
8433
8431
|
comp = Qtrue;
|
8434
8432
|
case 2:
|
@@ -8470,12 +8468,11 @@ datetime_s_iso8601(int argc, VALUE *argv, VALUE klass)
|
|
8470
8468
|
{
|
8471
8469
|
VALUE str, sg, opt;
|
8472
8470
|
|
8473
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8474
|
-
if (!NIL_P(opt)) argc--;
|
8471
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8475
8472
|
|
8476
8473
|
switch (argc) {
|
8477
8474
|
case 0:
|
8478
|
-
str = rb_str_new2(
|
8475
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8479
8476
|
case 1:
|
8480
8477
|
sg = INT2FIX(DEFAULT_SG);
|
8481
8478
|
}
|
@@ -8485,7 +8482,7 @@ datetime_s_iso8601(int argc, VALUE *argv, VALUE klass)
|
|
8485
8482
|
VALUE argv2[2], hash;
|
8486
8483
|
argv2[0] = str;
|
8487
8484
|
argv2[1] = opt;
|
8488
|
-
if (!NIL_P(opt)) argc2
|
8485
|
+
if (!NIL_P(opt)) argc2++;
|
8489
8486
|
hash = date_s__iso8601(argc2, argv2, klass);
|
8490
8487
|
return dt_new_by_frags(klass, hash, sg);
|
8491
8488
|
}
|
@@ -8510,12 +8507,11 @@ datetime_s_rfc3339(int argc, VALUE *argv, VALUE klass)
|
|
8510
8507
|
{
|
8511
8508
|
VALUE str, sg, opt;
|
8512
8509
|
|
8513
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8514
|
-
if (!NIL_P(opt)) argc--;
|
8510
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8515
8511
|
|
8516
8512
|
switch (argc) {
|
8517
8513
|
case 0:
|
8518
|
-
str = rb_str_new2(
|
8514
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8519
8515
|
case 1:
|
8520
8516
|
sg = INT2FIX(DEFAULT_SG);
|
8521
8517
|
}
|
@@ -8550,12 +8546,11 @@ datetime_s_xmlschema(int argc, VALUE *argv, VALUE klass)
|
|
8550
8546
|
{
|
8551
8547
|
VALUE str, sg, opt;
|
8552
8548
|
|
8553
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8554
|
-
if (!NIL_P(opt)) argc--;
|
8549
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8555
8550
|
|
8556
8551
|
switch (argc) {
|
8557
8552
|
case 0:
|
8558
|
-
str = rb_str_new2(
|
8553
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8559
8554
|
case 1:
|
8560
8555
|
sg = INT2FIX(DEFAULT_SG);
|
8561
8556
|
}
|
@@ -8591,12 +8586,11 @@ datetime_s_rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
8591
8586
|
{
|
8592
8587
|
VALUE str, sg, opt;
|
8593
8588
|
|
8594
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8595
|
-
if (!NIL_P(opt)) argc--;
|
8589
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8596
8590
|
|
8597
8591
|
switch (argc) {
|
8598
8592
|
case 0:
|
8599
|
-
str = rb_str_new2(
|
8593
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME_RFC3339);
|
8600
8594
|
case 1:
|
8601
8595
|
sg = INT2FIX(DEFAULT_SG);
|
8602
8596
|
}
|
@@ -8631,12 +8625,11 @@ datetime_s_httpdate(int argc, VALUE *argv, VALUE klass)
|
|
8631
8625
|
{
|
8632
8626
|
VALUE str, sg, opt;
|
8633
8627
|
|
8634
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8635
|
-
if (!NIL_P(opt)) argc--;
|
8628
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8636
8629
|
|
8637
8630
|
switch (argc) {
|
8638
8631
|
case 0:
|
8639
|
-
str = rb_str_new2(
|
8632
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME_HTTPDATE);
|
8640
8633
|
case 1:
|
8641
8634
|
sg = INT2FIX(DEFAULT_SG);
|
8642
8635
|
}
|
@@ -8676,12 +8669,11 @@ datetime_s_jisx0301(int argc, VALUE *argv, VALUE klass)
|
|
8676
8669
|
{
|
8677
8670
|
VALUE str, sg, opt;
|
8678
8671
|
|
8679
|
-
rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8680
|
-
if (!NIL_P(opt)) argc--;
|
8672
|
+
argc = rb_scan_args(argc, argv, "02:", &str, &sg, &opt);
|
8681
8673
|
|
8682
8674
|
switch (argc) {
|
8683
8675
|
case 0:
|
8684
|
-
str = rb_str_new2(
|
8676
|
+
str = rb_str_new2(JULIAN_EPOCH_DATETIME);
|
8685
8677
|
case 1:
|
8686
8678
|
sg = INT2FIX(DEFAULT_SG);
|
8687
8679
|
}
|
@@ -8962,9 +8954,10 @@ date_to_time(VALUE self)
|
|
8962
8954
|
get_d1a(self);
|
8963
8955
|
|
8964
8956
|
if (m_julian_p(adat)) {
|
8965
|
-
|
8966
|
-
get_d1b(
|
8957
|
+
VALUE g = d_lite_gregorian(self);
|
8958
|
+
get_d1b(g);
|
8967
8959
|
adat = bdat;
|
8960
|
+
self = g;
|
8968
8961
|
}
|
8969
8962
|
|
8970
8963
|
t = f_local3(rb_cTime,
|
@@ -9042,9 +9035,10 @@ datetime_to_time(VALUE self)
|
|
9042
9035
|
get_d1(self);
|
9043
9036
|
|
9044
9037
|
if (m_julian_p(dat)) {
|
9045
|
-
|
9046
|
-
get_d1a(
|
9038
|
+
VALUE g = d_lite_gregorian(self);
|
9039
|
+
get_d1a(g);
|
9047
9040
|
dat = adat;
|
9041
|
+
self = g;
|
9048
9042
|
}
|
9049
9043
|
|
9050
9044
|
{
|
data/ext/date/extconf.rb
CHANGED
@@ -3,6 +3,7 @@ require 'mkmf'
|
|
3
3
|
|
4
4
|
config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
|
5
5
|
|
6
|
+
append_cflags("-Wno-compound-token-split-by-macro") if RUBY_VERSION < "2.7."
|
6
7
|
have_func("rb_category_warn")
|
7
8
|
with_werror("", {:werror => true}) do |opt, |
|
8
9
|
have_var("timezone", "time.h", opt)
|
data/lib/date.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tadayoshi Funaba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A subclass of Object includes Comparable module for handling dates.
|
14
14
|
email:
|