line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package XML::LibXSLT::Easy::CLI; |
4
|
1
|
|
|
1
|
|
3002
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use XML::LibXSLT::Easy; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use MooseX::Types::Path::Class; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use namespace::clean -except => [qw(meta)]; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with qw(MooseX::Getopt); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has [qw(xml xsl out)] => ( |
15
|
|
|
|
|
|
|
isa => "Path::Class::File", |
16
|
|
|
|
|
|
|
is => "rw", |
17
|
|
|
|
|
|
|
coerce => 1, |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has out => ( |
23
|
|
|
|
|
|
|
isa => "Path::Class::File", |
24
|
|
|
|
|
|
|
is => "rw", |
25
|
|
|
|
|
|
|
coerce => 1, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has proc => ( |
29
|
|
|
|
|
|
|
traits => [qw(NoGetopt)], |
30
|
|
|
|
|
|
|
isa => "XML::LibXSLT::Easy", |
31
|
|
|
|
|
|
|
is => "rw", |
32
|
|
|
|
|
|
|
lazy_build => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _build_proc { |
36
|
|
|
|
|
|
|
XML::LibXSLT::Easy->new; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub run { |
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
$self = $self->new_with_options unless ref $self; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->proc->process( |
44
|
|
|
|
|
|
|
xml => $self->xml, |
45
|
|
|
|
|
|
|
xsl => $self->xsl, |
46
|
|
|
|
|
|
|
out => ( $self->out || \*STDOUT ), |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__PACKAGE__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=pod |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
XML::LibXSLT::Easy::CLI - |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use XML::LibXSLT::Easy::CLI; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|