Skip to content

add missing #warn in #init_with for #yaml_initialize deprecation #53

Merged
merged 1 commit into from Mar 23, 2012

2 participants

@eregon
eregon commented Mar 23, 2012

Hello,
I found the deprecation message when #yaml_initialize is defined (and not #init_with) is never outputed, due to a missing puts or warn.

By the way, what is the recommended way to be compatible with all YAML implementations for loading (and dumping) custom classes?
Defining both #yaml_initialize and #init_with ? Is there some documentation on this?

In my case, the default Object dumper/loader works fine, except for the frozen? status (the loaded object is no more frozen?).

@tenderlove
Owner

Oops! Thanks for the pull request.

In places where I've seen yaml_initialize, I've been implementing both for backwards compatibility. The specification object in rubygems is the first one that comes to mind. I haven't written any documentation along those lines (besides the apparently non-functional warning).

Ya, I don't think frozen has ever been supported, though I'm not against supporting it (we just need to figure out how).

@tenderlove tenderlove merged commit 986fe21 into tenderlove:master Mar 23, 2012
@eregon
eregon commented Mar 23, 2012

I haven't written any documentation along those lines (besides the apparently non-functional warning).

It would be really worth it to have an up-to-date documentation for dumping/loading YAML, the only one I found is a very old blog post. I'd be happy to write some, but I would need somebody to help me to be accurate.

Ya, I don't think frozen has ever been supported, though I'm not against supporting it (we just need to figure out how).

It's probably fine to not support it currently, it's rarely used and immutable objects likely have other setup when being loaded (Marshal does not support it either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.