Nim::Plugin::Template::MicroTemplate does not work on Text::MicroTemplate 0.16 or newer #1

Open
nyarla opened this Issue Nov 1, 2010 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

nyarla commented Nov 1, 2010

Nim::Plugin::Template::MicroTemplate does not work Text::MicroTemplate ( 0.16? 0.17?) or newer.

Error code:

could not find template file: /entry.html (include_path: templates) at /home/nyarla/local/nim/lib/Nim/Plugin/Template/MicroTemplate.pm line 58
 at /home/nyarla/local/nim/bin/nim line 14
        main::__ANON__('could not find template file: /entry.html (include_path: temp...') called at /usr/lib/perl5/5.10/Carp.pm line 44
        Carp::croak('could not find template file: /entry.html (include_path: temp...') called at /usr/lib/perl5/site_perl/5.10/Text/MicroTemplate/File.pm line 69
        Text::MicroTemplate::File::build_file('Text::MicroTemplate::Extended=HASH(0x1579cf8)', '/entry.html') called at /usr/lib/perl5/site_perl/5.10/Text/MicroTemplate/Extended.pm line 102
        Text::MicroTemplate::Extended::render_file('Text::MicroTemplate::Extended=HASH(0x1579cf8)', '/entry.html') called at /home/nyarla/local/nim/lib/Nim/Plugin/Template/MicroTemplate.pm line 58
        Nim::Plugin::Template::MicroTemplate::interpolate_entry('Nim::Plugin::Template::MicroTemplate=HASH(0x1272bf0)', 'Nim=HASH(0xb1d3b0)', 'Nim::Entry=HASH(0x14d1138)') called at /home/nyarla/local/nim/lib/Nim.pm line 99
        Nim::run_hook('Nim=HASH(0xb1d3b0)', 'entry.interpolate', 'Nim::Entry=HASH(0x14d1138)') called at /home/nyarla/local/nim/lib/Nim.pm line 73
        Nim::run_hooks('Nim=HASH(0xb1d3b0)') called at /home/nyarla/local/nim/lib/Nim.pm line 62
        Nim::run('Nim=HASH(0xb1d3b0)') called at /home/nyarla/local/nim/bin/nim line 23

My fix code:

# in Nim::Plugin::Template::MicroTemplate line 89
if (-f $t) {
    $t =~ s/^$dir//;

# fix this    
if (-f $t) {
    $t =~ s/^$dir//;
    $t =~ s{^/*}{};     # added: remove '/' prefix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment