Commit ad156f7
[ruby/date] Fix cannot load complex into simple error when loading marshal dump (Fixes #20)
This problem exists because Marshal.load calls Date.allocate, which
uses a SimpleDateData. There doesn't seem to be any support for
taking an existing Date instance and converting it from SimpleDateData
to ComplexDateData. Work around this issue by making Date.allocate
use a ComplexDateData. This causes problems in Date#initialize,
so remove the Date#initialize method (keeping the date_initialize
function, used internally for Date.civil). Alias Date.new to
Date.civil, since they do the same thing.
ruby/date@6bb8d8fa0f1 parent d1af234 commit ad156f7
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9318 | 9318 | | |
9319 | 9319 | | |
9320 | 9320 | | |
9321 | | - | |
| 9321 | + | |
9322 | 9322 | | |
9323 | 9323 | | |
9324 | 9324 | | |
| |||
9368 | 9368 | | |
9369 | 9369 | | |
9370 | 9370 | | |
| 9371 | + | |
9371 | 9372 | | |
9372 | 9373 | | |
9373 | 9374 | | |
| |||
9395 | 9396 | | |
9396 | 9397 | | |
9397 | 9398 | | |
9398 | | - | |
9399 | 9399 | | |
9400 | 9400 | | |
9401 | 9401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
0 commit comments