line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSAN::Index::Library; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
164
|
use 5.008005; |
|
6
|
|
|
|
|
56
|
|
|
6
|
|
|
|
|
256
|
|
4
|
6
|
|
|
6
|
|
42
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
228
|
|
5
|
6
|
|
|
6
|
|
33
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
258
|
|
6
|
6
|
|
|
6
|
|
37
|
use Carp (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
5193
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.29'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub distribution { |
11
|
2
|
|
|
2
|
1
|
359
|
JSAN::Index::Distribution->retrieve( |
12
|
|
|
|
|
|
|
name => $_[0]->{distribution}, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub release { |
17
|
609
|
|
|
609
|
1
|
4032
|
JSAN::Index::Release->retrieve( |
18
|
|
|
|
|
|
|
id => $_[0]->{release}, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub retrieve { |
23
|
758
|
|
|
758
|
0
|
225074
|
my $class = shift; |
24
|
758
|
|
|
|
|
2741
|
my %params = @_; |
25
|
758
|
|
|
|
|
2476
|
my $sql = join " and ", map { "$_ = ?" } keys(%params); |
|
758
|
|
|
|
|
6470
|
|
26
|
758
|
|
|
|
|
4490
|
my @result = $class->select( "where $sql", values(%params) ); |
27
|
758
|
100
|
|
|
|
3891
|
if ( @result == 1 ) { |
28
|
611
|
|
|
|
|
3265
|
return $result[0]; |
29
|
|
|
|
|
|
|
} |
30
|
147
|
50
|
|
|
|
418
|
if ( @result > 1 ) { |
31
|
0
|
|
|
|
|
0
|
Carp::croak("Found more than one author record"); |
32
|
|
|
|
|
|
|
} else { |
33
|
147
|
|
|
|
|
694
|
return undef; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub extract_libs { |
38
|
1
|
|
|
1
|
1
|
1101
|
my $self = shift; |
39
|
1
|
|
|
|
|
6
|
$self->extract_resource('lib', @_); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub extract_tests { |
43
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
44
|
0
|
|
|
|
|
0
|
$self->extract_resource('tests', @_); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub extract_resource { |
48
|
1
|
|
|
1
|
0
|
6
|
shift->release->extract_resource(@_); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub search { |
52
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
53
|
0
|
|
|
|
|
0
|
my %params = @_; |
54
|
0
|
|
|
|
|
0
|
my $sql = join " and ", map { "$_ = ?" } keys(%params); |
|
0
|
|
|
|
|
0
|
|
55
|
0
|
|
|
|
|
0
|
my @result = $class->select( "where $sql", values(%params) ); |
56
|
|
|
|
|
|
|
return @result |
57
|
0
|
|
|
|
|
0
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub search_like { |
60
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
61
|
0
|
|
|
|
|
0
|
my %params = @_; |
62
|
0
|
|
|
|
|
0
|
my $sql = join " and ", map { "$_ like ?" } keys(%params); |
|
0
|
|
|
|
|
0
|
|
63
|
0
|
|
|
|
|
0
|
my @result = $class->select( "where $sql", values(%params) ); |
64
|
|
|
|
|
|
|
return @result |
65
|
0
|
|
|
|
|
0
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
###################################################################### |
72
|
|
|
|
|
|
|
# Generated by ORLite 1.25 (Unused parts are commented out) |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
#sub base { 'JSAN::Index' } |
75
|
|
|
|
|
|
|
# |
76
|
|
|
|
|
|
|
#sub table { 'library' } |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub select { |
79
|
758
|
|
|
758
|
1
|
1414
|
my $class = shift; |
80
|
758
|
|
|
|
|
1531
|
my $sql = 'select "name", "distribution", "release", "version", "doc" from library '; |
81
|
758
|
50
|
|
|
|
3218
|
$sql .= shift if @_; |
82
|
758
|
|
|
|
|
7283
|
my $rows = JSAN::Index->selectall_arrayref( $sql, { Slice => {} }, @_ ); |
83
|
758
|
|
|
|
|
997585
|
bless( $_, 'JSAN::Index::Library' ) foreach @$rows; |
84
|
758
|
50
|
|
|
|
4589
|
wantarray ? @$rows : $rows; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
#sub count { |
88
|
|
|
|
|
|
|
# my $class = shift; |
89
|
|
|
|
|
|
|
# my $sql = 'select count(*) from library '; |
90
|
|
|
|
|
|
|
# $sql .= shift if @_; |
91
|
|
|
|
|
|
|
# JSAN::Index->selectrow_array( $sql, {}, @_ ); |
92
|
|
|
|
|
|
|
#} |
93
|
|
|
|
|
|
|
# |
94
|
|
|
|
|
|
|
#sub iterate { |
95
|
|
|
|
|
|
|
# my $class = shift; |
96
|
|
|
|
|
|
|
# my $call = pop; |
97
|
|
|
|
|
|
|
# my $sql = 'select "name", "distribution", "release", "version", "doc" from library '; |
98
|
|
|
|
|
|
|
# $sql .= shift if @_; |
99
|
|
|
|
|
|
|
# my $sth = JSAN::Index->prepare( $sql ); |
100
|
|
|
|
|
|
|
# $sth->execute( @_ ); |
101
|
|
|
|
|
|
|
# while ( $_ = $sth->fetchrow_hashref ) { |
102
|
|
|
|
|
|
|
# bless( $_, 'JSAN::Index::Library' ); |
103
|
|
|
|
|
|
|
# $call->() or last; |
104
|
|
|
|
|
|
|
# } |
105
|
|
|
|
|
|
|
# $sth->finish; |
106
|
|
|
|
|
|
|
#} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub name { |
109
|
0
|
|
|
0
|
1
|
0
|
$_[0]->{name}; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
#sub distribution { |
113
|
|
|
|
|
|
|
# $_[0]->{distribution}; |
114
|
|
|
|
|
|
|
#} |
115
|
|
|
|
|
|
|
# |
116
|
|
|
|
|
|
|
#sub release { |
117
|
|
|
|
|
|
|
# $_[0]->{release}; |
118
|
|
|
|
|
|
|
#} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub version { |
121
|
1
|
|
|
1
|
1
|
7
|
$_[0]->{version}; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub doc { |
125
|
1
|
|
|
1
|
1
|
12
|
$_[0]->{doc}; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
1; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
__END__ |