File Coverage

blib/lib/Bio/GMOD/Util/CheckVersions/WormBase.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             package Bio::GMOD::Util::CheckVersions::WormBase;
2 1     1   33335 use strict;
  1         3  
  1         46  
3              
4 1     1   582 use Bio::GMOD::Util::CheckVersions;
  0            
  0            
5             use Bio::GMOD::Util::Rearrange;
6              
7             use vars qw/@ISA/;
8              
9             @ISA = qw/Bio::GMOD::Util::CheckVersions/;
10              
11             sub local_version {
12             my ($self,@p) = @_;
13             my ($path,$parent) = rearrange([qw/ACEDB_PATH PARENT/],@p);
14             my $adaptor = ($parent) ? $parent->adaptor : $self->adaptor;
15             $path ||= $adaptor->acedb_path . '/elegans';
16             my ($realdir,$modtime) = $self->read_symlink($path);
17             my ($installed) = $realdir =~ /(WS\d+)$/;
18             $installed = ($installed) ? $installed : 'None installed';
19              
20             my %response = ( title => 'WormBase, the C. elegans database',
21             site => "local installation at $path",
22             version => $installed,
23             released => $modtime,
24             status => ($installed ne 'None installed') ? 'SUCCESS' : $installed);
25             return (wantarray ? %response : $response{version});
26             }
27              
28              
29             # =head3 PACKAGES
30             # SITE IS OPTIONAL (reads PACKAGE from SiteDefaults)
31             # The site/local should be model for other subs
32             # Pass --site to override the default site for the currently selected adaptor
33             # Pass --local to fetch the version from the local filesystem
34             # (optionally include a --path option for the local path)
35             # Defaults to reading CURRENT_PACKAGE_SYMLINK in the SiteDefaults
36             # INFRASTRUCUTRE FOR COMPATIBILITY
37             # There should be a current_release symlink pointing to
38             # the current package version
39              
40             # Fetch the current version of the package
41             # This can be done by reading the local file system
42             # or from the CGI itself
43             #sub package_version {
44             # my ($self,@p) = @_;
45             # my ($path) = rearrange([qw/PATH/],@p);
46             # my $response;
47             # if ($path) {
48             # # Try to fetch the current package version from the local filesystem
49             # my ($realdir,$release,$modtime) = _read_symlink($path);
50             # $response = ( # title => 'WormBase, the C. elegans database',
51             # site => "local installation at $path",
52             # version => $release,
53             # released => $modtime,
54             # status => ($release ne 'None installed') ? 'success' : $release);
55             # } else {
56             # # If not trying to fetch the data from a local server,
57             # # just use the development server
58             # $response = _check_version_cgi($self->development_url);
59             # }
60             # return \%$response;
61             #}
62              
63              
64             __END__