| 1 | ############################################################################## | ||||||||||||||||||||
| 2 | # The Faq-O-Matic is Copyright 1997 by Jon Howell, all rights reserved. # | ||||||||||||||||||||
| 3 | # # | ||||||||||||||||||||
| 4 | # This program is free software; you can redistribute it and/or # | ||||||||||||||||||||
| 5 | # modify it under the terms of the GNU General Public License # | ||||||||||||||||||||
| 6 | # as published by the Free Software Foundation; either version 2 # | ||||||||||||||||||||
| 7 | # of the License, or (at your option) any later version. # | ||||||||||||||||||||
| 8 | # # | ||||||||||||||||||||
| 9 | # This program is distributed in the hope that it will be useful, # | ||||||||||||||||||||
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | ||||||||||||||||||||
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | ||||||||||||||||||||
| 12 | # GNU General Public License for more details. # | ||||||||||||||||||||
| 13 | # # | ||||||||||||||||||||
| 14 | # You should have received a copy of the GNU General Public License # | ||||||||||||||||||||
| 15 | # along with this program; if not, write to the Free Software # | ||||||||||||||||||||
| 16 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.# | ||||||||||||||||||||
| 17 | # # | ||||||||||||||||||||
| 18 | # Jon Howell can be contacted at: # | ||||||||||||||||||||
| 19 | # 6211 Sudikoff Lab, Dartmouth College # | ||||||||||||||||||||
| 20 | # Hanover, NH 03755-3510 # | ||||||||||||||||||||
| 21 | # jonh@cs.dartmouth.edu # | ||||||||||||||||||||
| 22 | # # | ||||||||||||||||||||
| 23 | # An electronic copy of the GPL is available at: # | ||||||||||||||||||||
| 24 | # http://www.gnu.org/copyleft/gpl.html # | ||||||||||||||||||||
| 25 | # # | ||||||||||||||||||||
| 26 | ############################################################################## | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | ### | ||||||||||||||||||||
| 31 | ### The Versions module is used by the installer and maintenance modules | ||||||||||||||||||||
| 32 | ### to keep track of upgrade status. | ||||||||||||||||||||
| 33 | ### | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | package FAQ::OMatic::Versions; | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 1 | ▶ | use FAQ::OMatic; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 38 | 1 | ▶ | use FAQ::OMatic::Item; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | ▶ | sub getVersion { | ||||||||||||||||||
|
Subroutine
getVersion: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 41 | 0 | my $property = shift; | |||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 0 | my $versionItem = new FAQ::OMatic::Item('versionFile', | |||||||||||||||||||
| 44 | $FAQ::OMatic::Config::metaDir); | ||||||||||||||||||||
| 45 | 0 | ▶ | return $versionItem->{$property} || ''; | ||||||||||||||||||
|
Condition0%0/2
$versionItem->{$property} || ''
MC/DC0%0/1
$versionItem->{$property} || ''
$versionItem->{$property}
Truth table0%0/2
A
A= $versionItem->{$property}
| |||||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 0 | ▶ | sub setVersion { | ||||||||||||||||||
|
Subroutine
setVersion: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 49 | 0 | my $property = shift; | |||||||||||||||||||
| 50 | 0 | ▶ | my $version = shift || $FAQ::OMatic::VERSION; | ||||||||||||||||||
|
Condition0%0/3
shift() || $FAQ::OMatic::VERSION
MC/DC0%0/2
shift() || $FAQ::OMatic::VERSION
shift()
$FAQ::OMatic::VERSION
Truth table0%0/3
A || B
A= shift()B= $FAQ::OMatic::VERSION
| |||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 0 | my $versionItem = new FAQ::OMatic::Item('versionFile', | |||||||||||||||||||
| 53 | $FAQ::OMatic::Config::metaDir); | ||||||||||||||||||||
| 54 | 0 | $versionItem->setProperty('Title', "Versions Data File"); | |||||||||||||||||||
| 55 | 0 | $versionItem->setProperty($property, $version); | |||||||||||||||||||
| 56 | 0 | $versionItem->saveToFile('versionFile', | |||||||||||||||||||
| 57 | $FAQ::OMatic::Config::metaDir); | ||||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 1 | 1; | |||||||||||||||||||