sysread / TOML-Tiny

A minimal TOML parser and serializer for perl 5
8 stars 6 forks source link

Possibility to switch away from DateTime::Format::RFC3339? #8

Closed guillemj closed 4 years ago

guillemj commented 4 years ago

I was looking for a perl TOML implementation for a project of mine , and this one looks nice, up-to-date and alive! But noticed that it is using the DateTime::Format::RFC3339 module, which is not very tiny. On my Debian sid system that ends up pulling up 27 MiB of dependencies.

Could there be a possibility to switch to something like Time::Piece::strptime instead?

sysread commented 4 years ago

Sorry for the slow response. Looking at the PR now.

sysread commented 4 years ago

This PR would break the module, since the TOML writer currently does require DateTime::Format::RFC3339 and uses it when it encounters a DateTime object. I'm a little swamped at the moment, so investigating rolling my own datetime formatter will take a little while. I am happy to accept PRs if you need that changed more quickly than I myself can manage.

sysread commented 4 years ago

It turns out that DateTime::Format::RFC3339 had easily adaptable formatting code. I've pushed 47eb95083fa2da85ad1dd1a6bcd8732ad07d6f6e, which adopts that module's formatter with a few changes to handle TOML floating date times. Once CI testing verifies, I will push this change to CPAN.

guillemj commented 4 years ago

Ah great, even better, thanks!

sysread commented 4 years ago

I just pushed v0.10 to CPAN.