line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Giblog::Command; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
69
|
|
5
|
2
|
|
|
2
|
|
11
|
use Carp 'confess'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
395
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
|
|
|
my $self = {@_}; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
0
|
|
|
|
return bless $self, ref $class || $class; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
sub api { shift->{api} } |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
0
|
1
|
|
sub run { confess 'Method "run" not implemented by subclass' } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=encoding utf8 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Giblog::Command - command base class |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
L is command base class. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
You can also create your command inheriting L like L, L or L. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 new |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$command->new(%args); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Create command object. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Arguments: |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over 2 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item * api |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
L object. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=back |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 api |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$command->api; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Get L object. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 run |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$command->run(@args); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Run command. This method is implemented by subclass. |