blob: 62f55c0f512881653204ba3f9b08f1a27ee7f009 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package jitterbug::WebService;
use Dancer ':syntax';
use jitterbug::Plugin::Redis;
use File::Spec;
set serializer => 'JSON';
get '/build/:project/:commit/:version' => sub {
my $project = params->{project};
my $commit = params->{commit};
my $version = params->{version};
my $conf = setting 'jitterbug';
my $file = File::Spec->catfile( $conf->{reports}->{dir},
$project, $commit, $version . '.txt' );
if ( -f $file ) {
open my $fh, '<', $file;
my @content = <$fh>;
close $fh;
{
commit => $commit,
version => $version,
content => join( '', @content ),
};
}
};
1;
|