Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use #inspect to serialize rules #310

Closed
ddfreyne opened this issue Apr 25, 2013 · 9 comments
Closed

Do not use #inspect to serialize rules #310

ddfreyne opened this issue Apr 25, 2013 · 9 comments

Comments

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Apr 25, 2013

See also Compass/compass#1260.

nanoc uses #inspect to serialize Rules in order to detect changes to Rules, but the Sass::Importers::Filesystem returns a different value for #inspect on every invocation.

Marshal.dump seems like a better choice, but fails with lambdas.

@gpakosz
Copy link
Member

@gpakosz gpakosz commented Apr 25, 2013

can nanoc rely on Marshal.dump and rescue with #inspect?

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Apr 26, 2013

@gpakosz That was my main idea too. I need to find out whether Marshal.dump works well, though (should be fast enough, should not serialise too much, and serialised objects should be comparable).

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Mar 22, 2014

This will be fixed in nanoc 4.0. Not something easy to fix in nanoc 3.x unfortunately. (See also the new Trello card for this issue.)

@ddfreyne ddfreyne closed this Mar 22, 2014
@gpakosz
Copy link
Member

@gpakosz gpakosz commented Apr 26, 2014

For those landing here, my workaround for nanoc 3.x is still valid: https://gist.github.com/gpakosz/5420177

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Apr 27, 2014

Reopening this, because this issue is fixable in 3.x, and worth fixing too.

@ddfreyne ddfreyne reopened this Apr 27, 2014
@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Apr 27, 2014

nanoc 4 has a Checksummer class that is probably worth backporting.

@ddfreyne ddfreyne mentioned this issue May 1, 2014
@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented May 1, 2014

A better fix for this is in #431.

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented May 4, 2014

This is fixed by #431, to be released in either 3.6.10 or 3.7.0.

@ddfreyne ddfreyne closed this May 4, 2014
@gpakosz
Copy link
Member

@gpakosz gpakosz commented Jul 15, 2014

This is not fixed by #431.

See rules_collection.rb#L211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants