Wx/cpan_connector.pm untested

filter: Statementstmt 0.0% 0 / 52 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 71 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
module_tree
2.0
new
2.0
CRAP 2.0
1 #this package is a connector from CPANPLUS to CPAN.
2 #(A CPANPLUS programmer's interface for CPAN.)
3  
4 #the commands I use are:
5 #$cpanp->module_tree()
6 #$mod->author->cpanid
7 #$mod->package_name
8 #$mod->package_version
9 #$mod->installed_version
10 #$mod->files();
11 #$mod->name
12 #
13 #
14 #
15 #
16 #
17 #
18 #
19 #
20 #
21 #
22 #$mod->package_is_perl_core
23 #
24  
25 package CPANPLUS::Shell::Wx::cpan_connector;
26 use CPAN;
27 use base qw(CPAN);
28 use Cwd;
29 use Data::Dumper;
30  
31 sub new{
32 my $class=shift;
33 my $self = $class->SUPER::new();
34 return $self;
35 }
36 sub module_tree{
37 my $self=shift;
38 my $name=shift;
39  
40 my $mod=CPAN::Shell->expand("Module",$name);
41 $mod=CPANPLUS::Shell::Wx::cpan_connector::Module($mod);
42 return $mod;
43 }
44  
45 package CPANPLUS::Shell::Wx::cpan_connector::Shell;
46  
47 package CPANPLUS::Shell::Wx::cpan_connector::Module;
48  
49 use base qw(CPAN::Module);
50 use Cwd;
51 use Data::Dumper;
52  
53 sub new{
54 my $class=shift;
55 my $mod=shift;
56 my $self = $class->SUPER::new($mod);
57 # bless($class,$mod);
58 return $self;
59 }
60 sub name{
61 my $self=shift;
62 return $self->{name};
63 }
64 sub details{
65 #not implemented:
66 #$info->{'Installed File'}
67 #$info->{'Version Installed'}
68 my $self=shift;
69 my %ret=();
70 $ret{Author}=$self->{RO}->{cpanid};
71 $ret{Description}=$self->{RO}->{description};
72 $ret{Version on CPAN}=$self->{RO}->{CPAN_VERSION};
73 $ret{chapterid}=$self->{RO}->{chapterid};
74 $ret{'Development Stage'}=$self->{RO}->{statd};
75 $ret{'Support Level'}=$self->{RO}->{stats};
76 $ret{'Language Used'}=$self->{RO}->{statl};
77 $ret{'Interface Style'}=$self->{RO}->{stati};
78 $ret{'Public License'}=$self->{RO}->{statp};
79 $ret{dslip}=$self->{RO}->{statd}.$self->{RO}->{stats}.$self->{RO}->{statl}.$self->{RO}->{stati}.$self->{RO}->{statp};
80 $ret{Package}=(split('/',$self->{RO}->{CPAN_FILE}))[-1];
81 $ret{Description}=$self->{RO}->{description};
82 return \%ret;
83 }
84 sub readme{
85 my $self=shift;
86 CPAN::Shell::readme($self->name);
87 }
88 1;