CrashTest.pl
changeset 16 76a5a48538e4
parent 12 c98d3fa4a948
child 17 c91535b1db3e
equal deleted inserted replaced
15:394f772a8105 16:76a5a48538e4
    14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15 
    15 
    16 use Mojolicious::Lite;
    16 use Mojolicious::Lite;
    17 use UUID;
    17 use UUID;
    18 use Mojo::JSON;
    18 use Mojo::JSON;
       
    19 use Mojo::ByteStream 'b';
    19 use Mojo::UserAgent;
    20 use Mojo::UserAgent;
    20 use lib 'lib';
    21 use lib 'lib';
    21 use CrashTest::Storage::FileSystem;
    22 use CrashTest::Storage::FileSystem;
    22 
    23 
    23 my @valid_params = qw/Add-ons Distributor ProductName ReleaseChannel StartupTime UserID Version BuildID CrashTime Comments/;
    24 my @valid_params = qw/Add-ons Distributor ProductName ReleaseChannel StartupTime UserID Version BuildID CrashTime Comments/;
    34     {
    35     {
    35         my ($scm, $repo, $scmpath, $rev) = ($1, $2, $3, $4);
    36         my ($scm, $repo, $scmpath, $rev) = ($1, $2, $3, $4);
    36         my $filename = File::Spec->splitpath($scmpath);
    37         my $filename = File::Spec->splitpath($scmpath);
    37         my $scmrepo = "$scm:$repo";
    38         my $scmrepo = "$scm:$repo";
    38         if(exists($config->{ScmLinks}->{$scmrepo})) {
    39         if(exists($config->{ScmLinks}->{$scmrepo})) {
    39             return Mojo::ByteStream->new($self->link_to("$filename:$line" =>
    40             return b($self->link_to("$filename:$line" =>
    40                     $self->render(inline => $config->{ScmLinks}->{$scmrepo},
    41                     $self->render(inline => $config->{ScmLinks}->{$scmrepo},
    41                         repo => $repo, scmpath => $scmpath, rev => $rev, line => $line, partial => 1)
    42                         repo => $repo, scmpath => $scmpath, rev => $rev, line => $line, partial => 1)
    42                 ));
    43                 ));
    43         }
    44         }
    44         #return $file;
    45         #return $file;
    61         $short_signature = "$1<>::$2()$3";
    62         $short_signature = "$1<>::$2()$3";
    62     } elsif($signature =~ qr{([^()]+)\(.*\)(.*)}) {
    63     } elsif($signature =~ qr{([^()]+)\(.*\)(.*)}) {
    63         # c/c++
    64         # c/c++
    64         $short_signature = "$1()$2";
    65         $short_signature = "$1()$2";
    65     }
    66     }
    66     return Mojo::ByteStream->new($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
    67     return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
    67 };
    68 };
    68 
    69 
    69 # Upload form in DATA section
    70 # Upload form in DATA section
    70 get '/' => sub {
    71 get '/' => sub {
    71     my $self = shift;
    72     my $self = shift;