Commit graph

418 commits

Author SHA1 Message Date
Jeremy Evans
0b23a8db60 Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
Dmitry Dygalo
022c18b60d [ruby/date] [Bug #21436] check for fixnum lower bound in m_ajd
Issue - https://bugs.ruby-lang.org/issues/21436

Apparently, the lower bound check is missing, which results in overflow & wrapping later on in RB_INT2FIX

Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com>

67d75e8423
2025-06-15 16:12:45 +00:00
Dmitry Dygalo
c1877d431e [ruby/date] [Bug #21437] Date#hash for large years
Addresses https://bugs.ruby-lang.org/issues/21437

Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com>

31f07bc576
2025-06-15 16:11:06 +00:00
Jean Boussier
fb0dbbc0e6 [ruby/date] d_lite_marshal_load: copy ivars in the right order
dbf4e957dc
2025-06-13 17:46:10 +00:00
Jean Boussier
99a72df16d [ruby/date] Remove references to FL_EXIVAR
This flag isn't really meant to be public, it's an implementation
detail of Ruby.

And checking it before calling `rb_copy_generic_ivar` only save
a function call.

8175252653
2025-06-13 17:40:43 +00:00
Nobuyoshi Nakada
f45aa1505f [ruby/date] Update zonetab.h at 2025-06-11
b28617cde0
2025-06-11 10:05:39 +00:00
Nobuyoshi Nakada
998e5791c5 [ruby/date] Suppress warnings by gcc-13 with -Og
6dd7969a64
2025-06-05 14:18:38 +00:00
Susan van den Broek
76aaf8ddf4 [ruby/date] Add license files (COPYING, BSDL) to gem files
a3d85e0be5
2025-03-18 07:28:50 +00:00
Nobuyoshi Nakada
384e6945ac [ruby/date] Enclose dangling else in braces and fix -Wmisleading-indentation
```
date_strptime.c:253:324: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
  253 |   ...((VALUE)RUBY_Qtrue)); return 0; } while (0); si += l; } while (0);
      |                                                   ^
date_strptime.c:252:7: note: previous statement is here
  252 |       else
      |       ^
```

41aed5b746
2025-01-13 03:12:28 +00:00
Ryan Bigg
778e73b2b3 [ruby/date] Simplify description of this library
904d4b9607
2024-12-26 10:27:24 +09:00
Stan Lo
6d00dee30a [ruby/date] Fix broken rdoc-ref to the calendar page
cb52e64be1
2024-12-15 06:20:10 +00:00
Hiroshi SHIBATA
229592f175 [ruby/date] Bump up 3.4.1
a3295ad262
2024-12-02 07:51:06 +00:00
Nobuyoshi Nakada
43dd9c721f [ruby/date] Fix mixed declarations and code
This still support ruby 2.6 which does not require C99.

61d849758f
2024-11-29 02:48:10 +00:00
Nobuyoshi Nakada
b910de641b [ruby/date] Suppress compound-token-split-by-macro warnings
It was used intentionally.

291b40f939
2024-11-29 02:48:09 +00:00
Nobuyoshi Nakada
511954dd5c [ruby/date] Extract Julian calendar epoch literals
e677e99a86
2024-11-05 04:19:40 +00:00
Nobuyoshi Nakada
c51feedbfd [ruby/date] Update argc by rb_scan_args not to contain keywords
f277463439
2024-11-05 04:19:39 +00:00
Dmitrii Zudin
ee4599dbe7 [ruby/date] Fix incorrect argc2 decrement in datetime_s_iso8601 function
Replace the decrement (argc2--) with an increment (argc2++) for
the correct number of arguments when opt is provided.

b6974b00d8
2024-11-05 03:38:13 +00:00
Hiroshi SHIBATA
bb5f28c8f7 [ruby/date] Bump up v3.4.0
94f8e51e65
2024-11-01 13:42:16 +09:00
eileencodes
d25b74b32c Resize arrays in rb_ary_freeze and use it for freezing arrays
While working on a separate issue we found that in some cases
`ary_heap_realloc` was being called on frozen arrays. To fix this, this
change does the following:

1) Updates `rb_ary_freeze` to assert the type is an array, return if
already frozen, and shrink the capacity if it is not embedded, shared
or a shared root.
2) Replaces `rb_obj_freeze` with `rb_ary_freeze` when the object is
always an array.
3) In `ary_heap_realloc`, ensure the new capa is set with
`ARY_SET_CAPA`. Previously the change in capa was not set.
4) Adds an assertion to `ary_heap_realloc` that the array is not frozen.

Some of this work was originally done in
https://github.com/ruby/ruby/pull/2640, referencing this issue
https://bugs.ruby-lang.org/issues/16291. There didn't appear to be any
objections to this PR, it appears to have simply lost traction.

The original PR made changes to arrays and strings at the same time,
this PR only does arrays. Also it was old enough that rather than revive
that branch I've made a new one. I added Lourens as co-author in addtion
to Aaron who helped me with this patch.

The original PR made this change for performance reasons, and while
that's still true for this PR, the goal of this PR is to avoid
calling `ary_heap_realloc` on frozen arrays. The capacity should be
shrunk _before_ the array is frozen, not after.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: methodmissing <lourens@methodmissing.com>
2024-07-02 10:34:23 -07:00
Nobuyoshi Nakada
04c86a63cd [ruby/date] Update zonetab.h at 2024-06-26
ef5a0dac5b
2024-06-26 10:01:21 +00:00
Nobuyoshi Nakada
865a2027a1 [ruby/date] Use locale insensitive casecmp
cfbd6a6b13
2024-06-24 15:36:56 +00:00
Nobuyoshi Nakada
7aafd3ed0e [ruby/date] Use strncasecmp
5974ac9c7e
2024-06-24 15:36:56 +00:00
Nobuyoshi Nakada
12e66f11e5 [ruby/date] Use gperf 3.1 to generate ANSI-C code
5d67437b1f
2024-06-24 15:36:55 +00:00
Nobuyoshi Nakada
c2fd3dfb98
[ruby/date] Update zonetab.h at 2024-06-19
8e5efd4f59
2024-06-20 15:16:48 +09:00
p0pemaru
cb6dcc7746 [ruby/date] [DOC] specify the unit of return value for Date#-
b3a2c7611e
2024-06-03 05:24:18 +00:00
Nobuyoshi Nakada
77e5e06846 [ruby/date] Prevent converted gregorian date from GC
`m_sf_in_sec` calls `rb_rational_new` that can cause GC.

6de449ab6a
2024-06-03 05:23:44 +00:00
卜部昌平
c844968b72 ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
Nobuyoshi Nakada
2e6f8554f8 [ruby/date] Remove the unintentional ability to parse Symbol
It's been 2 years since ruby/date#49, so it's okay.

435dfec6c8
2024-02-21 16:04:52 +00:00
Mark Young
cb6a556927 [ruby/date] Provide a 'Changelog' link on rubygems.org/gems/date
By providing a 'changelog_uri' in the metadata of the gemspec
a 'Changelog' link will be shown on https://rubygems.org/gems/date
which makes it quick and easy for someone to check on the changes
introduced with a new version.

Details of this functionality can be found on https://guides.rubygems.org/specification-reference/

2dea4c011d
2023-12-25 21:12:49 +09:00
Hiroshi SHIBATA
da2cf947bc [ruby/date] Bump up 3.3.4
50e18d2684
2023-11-07 04:16:02 +00:00
BurdetteLamar
7ffee5681f [ruby/date] [DOC] Fix link
2adb917487
2023-09-20 19:48:28 +00:00
Matt Valentine-House
5e4b80177e Update the depend files 2023-02-28 09:09:00 -08:00
Matt Valentine-House
f38c6552f9 Remove intern/gc.h from Make deps 2023-02-27 10:11:56 -08:00
Burdette Lamar
3d53827130 [ruby/date] Removed (newly unneeded) alias remarks
(https://github.com/ruby/date/pull/88)

cfa7e9868b
2023-02-19 22:24:39 +00:00
Nobuyoshi Nakada
899ea35035
Extract include/ruby/internal/attr/packed_struct.h
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the
macros bellow:
* `RBIMPL_ATTR_PACKED_STRUCT_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_END`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
2023-02-08 12:34:13 +09:00
Hiroshi SHIBATA
1998d97908
[ruby/date] Bump version to 3.3.3
ea3644a7c4
2022-12-19 10:50:21 +09:00
Nobuyoshi Nakada
c316a5f2f1 [ruby/date] Adjust format [ci skip]
71c35b4054
2022-12-18 03:03:54 +00:00
Nobuyoshi Nakada
b8cc0992c6 [ruby/date] Extract head_match_p and abbreviated name length constants
3f666fa882
2022-12-18 02:58:51 +00:00
Nobuyoshi Nakada
df49bf8150 [ruby/date] Consider the length of string to parse
3bfed83ce7
2022-12-18 02:58:50 +00:00
Nobuyoshi Nakada
49dc424ff3 [ruby/date] Remove extz_pats table
945e26e243
2022-12-18 02:58:49 +00:00
Nobuyoshi Nakada
70c905963e [ruby/date] Remove merid_names table
7fe2bd5f94
2022-12-18 02:58:48 +00:00
Nobuyoshi Nakada
6efeaabef0 [ruby/date] Match abbreviated day and month names with head of full names
a45f8f03c9
2022-12-18 02:58:47 +00:00
Hiroshi SHIBATA
11f3bef260 [ruby/date] Bump version to 3.3.2
7afd9d4615
2022-12-16 06:36:03 +00:00
Hiroshi SHIBATA
bec7deba30 [ruby/date] Fixed wrong minimum version of Ruby
Fixed https://github.com/ruby/date/issues/83

9731a3e732
2022-12-14 07:56:09 +00:00
zverok
1859784422 [ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keys
6bb6d3a810
2022-12-13 19:52:06 +00:00
Hiroshi SHIBATA
01cf3ab3b8 [ruby/date] Bump version to 3.3.1
b7a8229041
2022-12-09 07:57:33 +00:00
Charles Oliver Nutter
e96b64f5e7 [ruby/date] No-op gem for JRuby for now
Remove all shipped files and require path on JRuby until we can
add JRuby's extension to the gem.

Temporary workaround for #48

94c3becef2
2022-12-09 07:55:07 +00:00
Hiroshi SHIBATA
774dad4915 [ruby/date] Bump version to 3.3.0
ac1642cf39
2022-12-05 05:19:16 +00:00
Nobuyoshi Nakada
739ad81ff1 [ruby/date] Check month range as civil 2022-10-27 05:36:11 +00:00
Nobuyoshi Nakada
3539da64fc
[DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00