| 1 | package Tapper::Cmd::Requested; | ||||||||||
| 2 | 8 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||
| 3 | 8 | $Tapper::Cmd::Requested::VERSION = '5.0.14'; | |||||||||
| 4 | 8 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 8 | ▶ | use Tapper::Model 'model'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 8 | ▶ | use parent 'Tapper::Cmd'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | sub add_host { | ||||||||
|
Subroutine
add_host: called CC=3 SCAR=11.6
Pod
documented
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | my ( $self, $testrun_id, $i_host_id ) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | if ( $i_host_id !~ /^\d+$/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 1 | ▶ | if ( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | !( | ||||||||||
| 20 | $i_host_id = | ||||||||||
| 21 | model('TestrunDB') | ||||||||||
| 22 | ->resultset('Host') | ||||||||||
| 23 | ->search({ name => $i_host_id },{ rows => 1 }) | ||||||||||
| 24 | ->first | ||||||||||
| 25 | ->id | ||||||||||
| 26 | ) | ||||||||||
| 27 | ) { | ||||||||||
| 28 | 0 | return; | |||||||||
| 29 | } | ||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 1 | my $or_request = | |||||||||
| 33 | model('TestrunDB') | ||||||||||
| 34 | ->resultset('TestrunRequestedHost') | ||||||||||
| 35 | ->new({ testrun_id => $testrun_id, host_id => $i_host_id }) | ||||||||||
| 36 | ; | ||||||||||
| 37 | 1 | $or_request->insert(); | |||||||||
| 38 | |||||||||||
| 39 | 1 | return $or_request->id; | |||||||||
| 40 | |||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub add_feature { | ||||||||
|
Subroutine
add_feature: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 45 | 1 | my ($self, $id, $feature) = @_; | |||||||||
| 46 | |||||||||||
| 47 | 1 | my $request = model('TestrunDB')->resultset('TestrunRequestedFeature')->new({testrun_id => $id, feature => $feature}); | |||||||||
| 48 | 1 | $request->insert(); | |||||||||
| 49 | 1 | return $request->id; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | |||||||||||
| 53 | |||||||||||
| 54 | |||||||||||
| 55 | 8 | 1; # End of Tapper::Cmd::Testrun | |||||||||
| 56 | |||||||||||
| 57 | __END__ | ||||||||||