Skip to content

Instantly share code, notes, and snippets.

@hanabokuro
Created July 2, 2012 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanabokuro/3031761 to your computer and use it in GitHub Desktop.
Save hanabokuro/3031761 to your computer and use it in GitHub Desktop.
Text::Xslate::_magic_token
sub _magic_token {
my($self, $fullpath) = @_;
$self->{serial_opt} ||= Data::MessagePack->pack([
ref($self->{compiler}) || $self->{compiler},
$self->_filter_options_for_magic_token($self->_extract_options($self->parser_option)),
$self->_filter_options_for_magic_token($self->_extract_options($self->compiler_option)),
$self->input_layer,
[sort keys %{ $self->{function} }],
]);
if(ref $fullpath) { # ref to content string
$fullpath = join ':', ref($fullpath),
$self->_digest(${$fullpath});
}
return sprintf $XSLATE_MAGIC, $fullpath, $self->{serial_opt};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment