| 1 | package Net::Jenkins::Job::Build; | ||||||||||
| 2 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use methods; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use DateTime; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | |||||||||||
| 7 | # { | ||||||||||
| 8 | # 'number' => 2, | ||||||||||
| 9 | # 'url' => 'http://localhost:8080/job/Phifty/2/' | ||||||||||
| 10 | # }, | ||||||||||
| 11 | |||||||||||
| 12 | 2 | has number => ( is => 'rw' , isa => 'Int' ); | |||||||||
| 13 | |||||||||||
| 14 | 2 | has url => ( is => 'rw', isa => 'Str' ); | |||||||||
| 15 | |||||||||||
| 16 | 2 | has job => ( is => 'rw', isa => 'Net::Jenkins::Job' ); | |||||||||
| 17 | |||||||||||
| 18 | 2 | has api => ( is => 'rw' , isa => 'Net::Jenkins' ); | |||||||||
| 19 | |||||||||||
| 20 | 2 | ▶ | method details { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | return $self->api->get_build_details( $self->job->name, $self->number ); | |||||||||
| 22 | 2 | } | |||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | method result { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
result: not called CC=1 SCAR=3.5
| |||||||||||
| 25 | 0 | return $self->details->{result}; | |||||||||
| 26 | 2 | } | |||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | method building { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=4.1
Subroutine
__ANON__: not called CC=1 SCAR=4.9
Subroutine
building: not called CC=1 SCAR=4.9
| |||||||||||
| 29 | 0 | return $self->details->{building}; | |||||||||
| 30 | 2 | } | |||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | method id { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
id: not called CC=1 SCAR=3.5
| |||||||||||
| 33 | 0 | return $self->details->{id}; | |||||||||
| 34 | 2 | } | |||||||||
| 35 | |||||||||||
| 36 | 2 | ▶ | method name { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
name: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 1 | return $self->details->{fullDisplayName}; | |||||||||
| 38 | 2 | } | |||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | method created_at { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
created_at: not called CC=1 SCAR=3.5
| |||||||||||
| 41 | 0 | return DateTime->from_epoch( epoch => $self->details->{timestamp} ); | |||||||||
| 42 | 2 | } | |||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | method console { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
console: not called CC=1 SCAR=3.5
| |||||||||||
| 45 | 0 | return $self->api->get_build_console( $self->job->name, $self->number ); | |||||||||
| 46 | 2 | } | |||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | method console_handle { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
__ANON__: not called CC=1 SCAR=3.5
| |||||||||||
| 49 | 0 | return $self->api->get_build_console_handle( $self->job->name , $self->number ); | |||||||||
| 50 | 2 | } | |||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | method to_hashref ($with_details) { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=3.5
Subroutine
__ANON__: not called CC=2 SCAR=15.1
| |||||||||||
| 53 | return { | ||||||||||
| 54 | 0 | ▶ | number => $self->number, | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | url => $self->url, | ||||||||||
| 56 | job => $self->job->to_hashref, | ||||||||||
| 57 | ($with_details ? | ||||||||||
| 58 | ( details => $self->details ) : () ), | ||||||||||
| 59 | }; | ||||||||||
| 60 | 2 | } | |||||||||
| 61 | |||||||||||
| 62 | 2 | 1; | |||||||||
| 63 | __END__ | ||||||||||