line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSAN::Index::Distribution; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
101
|
use 5.008005; |
|
6
|
|
|
|
|
67
|
|
|
6
|
|
|
|
|
256
|
|
4
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
169
|
|
5
|
6
|
|
|
6
|
|
39
|
use warnings; |
|
6
|
|
|
|
|
17
|
|
|
6
|
|
|
|
|
154
|
|
6
|
6
|
|
|
6
|
|
30
|
use JSAN::Index::Release (); |
|
6
|
|
|
|
|
17
|
|
|
6
|
|
|
|
|
4403
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.29'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub releases { |
11
|
3
|
|
|
3
|
1
|
27
|
JSAN::Index::Release->select('where distribution = ?', $_[0]->name); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub retrieve { |
15
|
6
|
|
|
6
|
0
|
1250
|
my $class = shift; |
16
|
6
|
|
|
|
|
41
|
my %params = @_; |
17
|
6
|
|
|
|
|
31
|
my $sql = join " and ", map { "$_ = ?" } keys(%params); |
|
6
|
|
|
|
|
43
|
|
18
|
6
|
|
|
|
|
94
|
my @result = $class->select( "where $sql", values(%params) ); |
19
|
6
|
50
|
|
|
|
43
|
if ( @result == 1 ) { |
20
|
6
|
|
|
|
|
74
|
return $result[0]; |
21
|
|
|
|
|
|
|
} |
22
|
0
|
0
|
|
|
|
0
|
if ( @result > 1 ) { |
23
|
0
|
|
|
|
|
0
|
Carp::croak("Found more than one author record"); |
24
|
|
|
|
|
|
|
} else { |
25
|
0
|
|
|
|
|
0
|
return undef; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub latest_release { |
30
|
2
|
|
|
2
|
1
|
1117
|
my $self = shift; |
31
|
2
|
|
|
|
|
24
|
my @releases = $self->releases; |
32
|
2
|
50
|
|
|
|
19
|
unless ( @releases ) { |
33
|
0
|
|
|
|
|
0
|
Carp::croak( "No releases found for distribution " . $self->name ); |
34
|
|
|
|
|
|
|
} |
35
|
2
|
|
|
|
|
20
|
@releases = sort { $b->version <=> $a->version } @releases; |
|
24
|
|
|
|
|
69
|
|
36
|
2
|
|
|
|
|
47
|
$releases[0]; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub search_like { |
41
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
42
|
0
|
|
|
|
|
0
|
my %params = @_; |
43
|
0
|
|
|
|
|
0
|
my $sql = join " and ", map { "$_ like ?" } keys(%params); |
|
0
|
|
|
|
|
0
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
0
|
my @result = $class->select( "where $sql", values(%params) ); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
return @result |
48
|
0
|
|
|
|
|
0
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub extract_libs { |
51
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
52
|
0
|
|
|
|
|
0
|
$self->extract_resource('lib', @_); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub extract_tests { |
56
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
57
|
0
|
|
|
|
|
0
|
$self->extract_resource('tests', @_); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub extract_resource { |
61
|
0
|
|
0
|
0
|
0
|
0
|
my $class = ref $_[0] || $_[0]; |
62
|
0
|
|
|
|
|
0
|
Carp::croak("$class does not implement method 'extract_resource'"); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
###################################################################### |
70
|
|
|
|
|
|
|
# Generated by ORLite 1.25 (Unused parts are commented out) |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#sub base { 'JSAN::Index' } |
73
|
|
|
|
|
|
|
# |
74
|
|
|
|
|
|
|
#sub table { 'distribution' } |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub select { |
77
|
6
|
|
|
6
|
1
|
23
|
my $class = shift; |
78
|
6
|
|
|
|
|
19
|
my $sql = 'select "name", "doc" from distribution '; |
79
|
6
|
50
|
|
|
|
54
|
$sql .= shift if @_; |
80
|
6
|
|
|
|
|
82
|
my $rows = JSAN::Index->selectall_arrayref( $sql, { Slice => {} }, @_ ); |
81
|
6
|
|
|
|
|
7258
|
bless( $_, 'JSAN::Index::Distribution' ) foreach @$rows; |
82
|
6
|
50
|
|
|
|
57
|
wantarray ? @$rows : $rows; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#sub count { |
86
|
|
|
|
|
|
|
# my $class = shift; |
87
|
|
|
|
|
|
|
# my $sql = 'select count(*) from distribution '; |
88
|
|
|
|
|
|
|
# $sql .= shift if @_; |
89
|
|
|
|
|
|
|
# JSAN::Index->selectrow_array( $sql, {}, @_ ); |
90
|
|
|
|
|
|
|
#} |
91
|
|
|
|
|
|
|
# |
92
|
|
|
|
|
|
|
#sub iterate { |
93
|
|
|
|
|
|
|
# my $class = shift; |
94
|
|
|
|
|
|
|
# my $call = pop; |
95
|
|
|
|
|
|
|
# my $sql = 'select "name", "doc" from distribution '; |
96
|
|
|
|
|
|
|
# $sql .= shift if @_; |
97
|
|
|
|
|
|
|
# my $sth = JSAN::Index->prepare( $sql ); |
98
|
|
|
|
|
|
|
# $sth->execute( @_ ); |
99
|
|
|
|
|
|
|
# while ( $_ = $sth->fetchrow_hashref ) { |
100
|
|
|
|
|
|
|
# bless( $_, 'JSAN::Index::Distribution' ); |
101
|
|
|
|
|
|
|
# $call->() or last; |
102
|
|
|
|
|
|
|
# } |
103
|
|
|
|
|
|
|
# $sth->finish; |
104
|
|
|
|
|
|
|
#} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub name { |
107
|
4
|
|
|
4
|
1
|
692
|
$_[0]->{name}; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub doc { |
112
|
1
|
|
|
1
|
1
|
10
|
$_[0]->{doc}; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
__END__ |