display all changes on disk
[MojoFacets.git] / lib / MojoFacets / Changes.pm
1 package MojoFacets::Changes;
2
3 use strict;
4 use warnings;
5
6 use base 'Mojolicious::Controller';
7
8 sub index {
9         my $self = shift;
10
11         my $changes;
12         foreach my $path ( glob '/tmp/changes/*' ) {
13                 if ( $path =~ m{/(\d+\.\d+)\.(.+)$} ) {
14                         push @$changes, [ $1, split(/\./, $2) ];
15                 } else {
16                         warn "ignore: $path\n";
17                 }
18         }
19
20         # Render template "changes/index.html.ep" with message
21         $self->render(message => 'Latest Changes', changes => $changes );
22 }
23
24 1;