blib/lib/App/OperaUtils.pm

filter: Statementstmt 76.9% 30 / 39 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod 100% 9 / 9 totaltotal 70.9% 44 / 62 CC 1 SCAR 5.0
CC
1
Cov
77%
ps_opera
2.0
pause_opera
2.0
unpause_opera
2.0
CRAP 1.6
↑ Summary
1 package App::OperaUtils;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict 'subs', 'vars';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Log::ger;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use App::BrowserUtils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 1 our $DATE = '2022-10-07'; # DATE
12 1 our $DIST = 'App-OperaUtils'; # DIST
13 1 our $VERSION = '0.008'; # VERSION
14  
15 1 our %SPEC;
16  
17 1 $SPEC{':package'} = {
18 v => 1.1,
19 summary => 'Utilities related to the Opera browser',
20 };
21  
22 $SPEC{ps_opera} = {
23 1 v => 1.1,
24 summary => "List Opera processes",
25 args => {
26 %App::BrowserUtils::args_common,
27 },
28 };
29 0 ▶sub ps_opera {
Subroutine ps_opera: not called CC=1 SCAR=6.9
Pod documented
30 0 App::BrowserUtils::_do_browser('ps', 'opera', @_);
31 }
32  
33 $SPEC{pause_opera} = {
34 1 v => 1.1,
35 summary => "Pause (kill -STOP) Opera",
36 description => $App::BrowserUtils::desc_pause,
37 args => {
38 %App::BrowserUtils::args_common,
39 },
40 };
41 0 ▶sub pause_opera {
Subroutine pause_opera: not called CC=1 SCAR=6.9
Pod documented
42 0 App::BrowserUtils::_do_browser('pause', 'opera', @_);
43 }
44  
45 $SPEC{unpause_opera} = {
46 1 v => 1.1,
47 summary => "Unpause (resume, continue, kill -CONT) Opera",
48 args => {
49 %App::BrowserUtils::args_common,
50 },
51 };
52 0 ▶sub unpause_opera {
Subroutine unpause_opera: not called CC=1 SCAR=6.9
Pod documented
53 0 App::BrowserUtils::_do_browser('unpause', 'opera', @_);
54 }
55  
56 $SPEC{opera_has_processes} = {
57 1 v => 1.1,
58 summary => "Check whether Opera has processes",
59 args => {
60 %App::BrowserUtils::args_common,
61 %App::BrowserUtils::argopt_quiet,
62 },
63 };
64 0 ▶sub opera_has_processes {
Subroutine opera_has_processes: not called CC=1 SCAR=6.9
Pod documented
65 0 App::BrowserUtils::_do_browser('has_processes', 'opera', @_);
66 }
67  
68 $SPEC{opera_is_paused} = {
69 1 v => 1.1,
70 summary => "Check whether Opera is paused",
71 description => <<'_',
72  
73 Opera is defined as paused if *all* of its processes are in 'stop' state.
74  
75 _
76 args => {
77 %App::BrowserUtils::args_common,
78 %App::BrowserUtils::argopt_quiet,
79 },
80 };
81 0 ▶sub opera_is_paused {
Subroutine opera_is_paused: not called CC=1 SCAR=6.9
Pod documented
82 0 App::BrowserUtils::_do_browser('is_paused', 'opera', @_);
83 }
84  
85 $SPEC{opera_is_running} = {
86 1 v => 1.1,
87 summary => "Check whether Opera is running",
88 description => <<'_',
89  
90 Opera is defined as running if there are some Opera processes that are *not*
91 in 'stop' state. In other words, if Opera has been started but is currently
92 paused, we do not say that it's running. If you want to check if Opera process
93 exists, you can use `ps_opera`.
94  
95 _
96 args => {
97 %App::BrowserUtils::args_common,
98 %App::BrowserUtils::argopt_quiet,
99 },
100 };
101 0 ▶sub opera_is_running {
Subroutine opera_is_running: not called CC=1 SCAR=6.9
Pod documented
102 0 App::BrowserUtils::_do_browser('is_running', 'opera', @_);
103 }
104  
105 $SPEC{terminate_opera} = {
106 1 v => 1.1,
107 summary => "Terminate (kill -KILL) Opera",
108 args => {
109 %App::BrowserUtils::args_common,
110 %App::BrowserUtils::argopt_signal,
111 },
112 };
113 0 ▶sub terminate_opera {
Subroutine terminate_opera: not called CC=1 SCAR=6.9
Pod documented
114 0 App::BrowserUtils::_do_browser('terminate', 'opera', @_);
115 }
116  
117 $SPEC{restart_opera} = {
118 1 v => 1.1,
119 summary => "Restart opera",
120 args => {
121 %App::BrowserUtils::argopt_opera_cmd,
122 %App::BrowserUtils::argopt_quiet,
123 },
124 features => {
125 dry_run => 1,
126 },
127 };
128 0 ▶sub restart_opera {
Subroutine restart_opera: not called CC=1 SCAR=6.9
Pod documented
129 0 App::BrowserUtils::restart_browsers(@_, restart_opera=>1);
130 }
131  
132 $SPEC{start_opera} = {
133 1 v => 1.1,
134 summary => "Start opera if not already started",
135 args => {
136 %App::BrowserUtils::argopt_opera_cmd,
137 %App::BrowserUtils::argopt_quiet,
138 },
139 features => {
140 dry_run => 1,
141 },
142 };
143 0 ▶sub start_opera {
Subroutine start_opera: not called CC=1 SCAR=6.9
Pod documented
144 0 App::BrowserUtils::start_browsers(@_, start_opera=>1);
145 }
146  
147 1 1;
148 # ABSTRACT: Utilities related to the Opera browser
149  
150 __END__
↑ Summary