Change JSONReportFormatter to handle versions of JSON.pm that don't add a newline at the end of the encoded json

This commit is contained in:
Brian Fraser
2013-01-30 17:47:41 -03:00
parent dbbb699831
commit 98f490492c
2 changed files with 6 additions and 2 deletions

View File

@@ -103,7 +103,9 @@ override query_report => sub {
};
}
return $self->encode_json(\@queries) . "\n";
my $json = $self->encode_json(\@queries);
$json .= "\n" if $json !~ /\n\Z/;
return $json . "\n";
};
1;