line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Nuspec::Reader; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.1.0'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
16251
|
use 5.012; |
|
2
|
|
|
|
|
6
|
|
6
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
105
|
|
7
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
8
|
2
|
|
|
2
|
|
898
|
use Class::Tiny qw( nuspec_filename ); |
|
2
|
|
|
|
|
4948
|
|
|
2
|
|
|
|
|
12
|
|
9
|
2
|
|
|
2
|
|
1394
|
use XML::LibXML; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use XML::LibXML::XPathContext; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub get_dependencies { |
13
|
|
|
|
|
|
|
my ($self) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $dom = XML::LibXML->load_xml(location => $self->nuspec_filename); |
16
|
|
|
|
|
|
|
my $xpath_context = XML::LibXML::XPathContext->new($dom->documentElement); |
17
|
|
|
|
|
|
|
$xpath_context->registerNs( |
18
|
|
|
|
|
|
|
ns => 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd' |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
my $dependency_xpath = |
21
|
|
|
|
|
|
|
'/ns:package' . |
22
|
|
|
|
|
|
|
'/ns:metadata' . |
23
|
|
|
|
|
|
|
'/ns:dependencies' . |
24
|
|
|
|
|
|
|
'/ns:dependency'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return [ |
27
|
|
|
|
|
|
|
map { |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
id => $_->findvalue('@id'), |
30
|
|
|
|
|
|
|
version => $_->findvalue('@version'), |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} $xpath_context->findnodes($dependency_xpath) |
33
|
|
|
|
|
|
|
] |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub get_files { |
37
|
|
|
|
|
|
|
... |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get_version { |
41
|
|
|
|
|
|
|
... |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub get_package_id { |
45
|
|
|
|
|
|
|
... |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |