Ado

 view release on metacpan or  search on metacpan

lib/Ado/Plugin/MarkdownRenderer.pm  view on Meta::CPAN

    unless ($file_path) { $c->reply->not_found() && return '' }
    my $fullname = catfile($config->{md_root}, $file_path);
    $c->debug("md_file: $file_path; \$fullname: $fullname");

    my ($name, $path, $suffix) = fileparse($fullname, @{$config->{md_file_sufixes}});
    my $html_filepath = catfile($path, "$name.html");

    #Reuse previously produced html file if md_file is older than the html file.
    if (   $config->{md_reuse_produced_html}
        && -s $html_filepath
        && (stat($fullname))[9] < (stat($html_filepath))[9])
    {
        $c->debug('Found ' . $html_filepath);
        return b(path($html_filepath)->slurp)->decode;
    }

    #404 Not Found
    my $md_filepath = catfile($path, "$name$suffix");
    unless (-s $md_filepath) { $c->reply->not_found() && return '' }

    my $markdown = path($md_filepath)->slurp;

t/ado-build.t  view on Meta::CPAN

}
stdout_like(sub { $build->dispatch('submit') }, qr/^TODO/, 'ACTION_submit output ok');
stdout_is(
    sub { $build->do_create_readme },
    "Created README\nCreated README.md\n",
    'do_create_readme() output ok'
);

#check if created files look fresh.
my $t = time();
my $R = stat('README');
ok($R->ctime - $t <= 1, 'README is fresh ok');
ok($R->size > 12,       'README has size ok');
$R = stat('README.md');
ok($R->ctime - $t <= 1, 'README.md is fresh ok');
ok($R->size > 12,       'README.md has size ok');

stdout_is(sub { $build->dispatch('distmeta') }, "Created META.yml and META.json\n",
    "distmeta ok");

my $dist_out = qr/
Creating\sAdo-\d+\.\d{2,}\n
Creating\sAdo-\d+\.\d{2,}\.tar.gz\n/x;



( run in 0.662 second using v1.01-cache-2.11-cpan-49f99fa48dc )