File Coverage

Bio/Root/Version.pm
Criterion Covered Total %
statement 14 14 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 3 3 100.0
pod n/a
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Bio::Root::Version;
2 296     296   1104 use strict;
  296         356  
  296         17226  
3              
4             =head1 SYNOPSIS
5              
6             package Bio::Tools::NiftyFeature;
7             require Bio::Root::RootI;
8              
9             # later, in client code:
10             package main;
11             use Bio::Tools::NiftyFeature 3.14;
12              
13             ## alternative usage: NiftyFeature defines own $VERSION:
14             package Bio::Tools::NiftyFeature;
15             my $VERSION = 9.8;
16              
17             # later in client code:
18             package main;
19              
20             # ensure we're using an up-to-date BioPerl distribution
21             use Bio::Perl 3.14;
22              
23             # NiftyFeature has its own versioning scheme:
24             use Bio::Tools::NiftyFeature 9.8;
25              
26             =head1 DESCRIPTION
27              
28             This module provides a mechanism by which all other BioPerl modules
29             can share the same $VERSION, without manually synchronizing each file.
30              
31             Bio::Root::RootI itself uses this module, so any module that directly
32             (or indirectly) uses Bio::Root::RootI will get a global $VERSION
33             variable set if it's not already.
34              
35             =head1 AUTHOR Aaron Mackey
36              
37             =cut
38              
39             our $VERSION = '1.007000_006';
40              
41             sub import {
42             # try to handle multiple levels of inheritance:
43 356     356   451 my $i = 0;
44 356         1405 my $pkg = caller($i);
45 296     296   1049 no strict 'refs';
  296         353  
  296         25529  
46 356         5909 while ($pkg) {
47 7318 100 100     57876 if ( $pkg =~ m/^Bio::/o
48 1653         8269 and not defined ${$pkg . "::VERSION"}
49             ) {
50 1310         1020 ${$pkg . "::VERSION"} = $VERSION;
  1310         3191  
51             }
52 7318         9326 $pkg = caller(++$i);
53             }
54             }
55              
56             1;
57              
58             __END__