# XXX Move this into a plugin!
use DateTime::Format::Human::Duration;
$c->stash->{time_since} = sub {
- my($dt, $now) = ($self, DateTime->now);
+ my($dt, $now) = ($_[0], DateTime->now);
my($age) = $dt < (DateTime->now - DateTime::Duration->new(days=>12))
? $dt->ymd
);
# This is fugly as fuck. Move Git::PurePerl construction into attribute builders..
- my ($pd, $gd) = $model->project_dir( $model->project )->resolve =~ m{((.+?)(:?/\/\.git)?$)};
+ my ($pd, $gd) = $model->project_dir( $model->project ) =~ m{((.+?)(:?/\/\.git)?$)};
$gd .= '/.git' if ($gd !~ /\.git$/ and -d "$gd/.git");
$model->gpp( Git::PurePerl->new(gitdir => $gd, directory => $pd) );
<td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', { 'p' => p.name } ) %]">[% p.description.substr(0, 20) %]</a></td>
<td>[% p.owner %]</td>
<td class="age2">[% p.last_change %]</td>
- <td class="link"><a href="[% c.uri_for("summary") %]">summary</a>
- | <a href="[% c.uri_for("shortlog") %]">shortlog</a>
- | <a href="[% c.uri_for("log") %]">log</a>
- | <a href="[% c.uri_for("tree") %]">tree</a></td>
+ <td class="link"><a href="[% c.uri_for("summary", {'p' => p.name}) %]">summary</a>
+ | <a href="[% c.uri_for("shortlog", {'p' => p.name}) %]">shortlog</a>
+ | <a href="[% c.uri_for("log", {'p' => p.name}) %]">log</a>
+ | <a href="[% c.uri_for("tree", {'p' => p.name}) %]">tree</a></td>
</tr>
[% END %]
</tbody>
$m->project('repo1');
is($m->project, 'repo1', 'model project correct');
my $pd = $m->project_dir($m->project);
+isa_ok($pd, 'Path::Class::Dir', 'model project_dir');
is($pd, $m->repo_dir . '/' . $m->project, 'model project_dir correct');
ok( $m->gpp(Git::PurePerl->new( gitdir => $pd, directory => $pd )), 'model gpp set ok' );
like($m->head_hash('HEAD'), qr/^([0-9a-fA-F]{40})$/, 'head_hash');
+bar
', 'patch->{diff} is correct');
is($patch->{dst}, '5716ca5987cbf97d6bb54920bea6adde242d87e6', 'patch->{dst} is correct');
-warn(Dumper($patch));
done_testing;