| 1 | package App::BCSSH::Handler::browse; | ||||||||||
| 2 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Browser::Open qw(open_browser); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | with 'App::BCSSH::Handler'; | |||||||||
| 6 | |||||||||||
| 7 | 1 | has browser => (is => 'ro'); | |||||||||
| 8 | 1 | has browse => (is => 'lazy', init_arg => undef); | |||||||||
| 9 | 0 | ▶ | sub _build_browse { | ||||||||
|
Subroutine
_build_browse: not called CC=3 SCAR=24.8
| |||||||||||
| 10 | 0 | my $self = shift; | |||||||||
| 11 | 0 | my $browser = $self->browser; | |||||||||
| 12 | 0 | ▶ | if ($browser) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | ▶ | my @browser = ref $browser ? @$browser : $browser; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | return sub { system @browser, @_ }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 15 | } | ||||||||||
| 16 | else { | ||||||||||
| 17 | 0 | return \&open_browser; | |||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub handle { | ||||||||
|
Subroutine
handle: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 22 | 0 | my ($self, $send, $args) = @_; | |||||||||
| 23 | 0 | my $urls = $args->{urls}; | |||||||||
| 24 | |||||||||||
| 25 | 0 | for my $url (@$urls) { | |||||||||
| 26 | 0 | $self->browse->($url); | |||||||||
| 27 | } | ||||||||||
| 28 | 0 | $send->(); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 1 | 1; | |||||||||