| 1 | package Backup::Omni::Constants; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | our $VERSION = '0.01'; | |||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Backup::Omni::Exception; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | use Badger::Class | ||||||||||
| 8 | 1 | ▶ | version => $VERSION, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | base => 'Badger::Constants', # grab the badger constants | ||||||||||
| 10 | import => 'class', | ||||||||||
| 11 | 1 | ; | |||||||||
| 12 | |||||||||||
| 13 | # ---------------------------------------------------------------------- | ||||||||||
| 14 | # Build our constants and export them | ||||||||||
| 15 | # ---------------------------------------------------------------------- | ||||||||||
| 16 | |||||||||||
| 17 | { | ||||||||||
| 18 | |||||||||||
| 19 | 1 | my $path = '/opt/omni/bin/%s'; | |||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | if ($^O eq "MSWin32") { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | if ($ENV{PATH} =~ m/;(.*OmniBack\\bin);/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | $path = $1 . '\\%s.exe'; | |||||||||
| 26 | |||||||||||
| 27 | } else { | ||||||||||
| 28 | |||||||||||
| 29 | 0 | $path = '"C:\\Program Files\\OmniBack\\bin\\%s.exe"'; | |||||||||
| 30 | |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 1 | my $constants = { | |||||||||
| 36 | OMNIR => sprintf($path, 'omnir'), | ||||||||||
| 37 | OMNIDB => sprintf($path, 'omnidb'), | ||||||||||
| 38 | OMNISTAT => sprintf($path, 'omnistat'), | ||||||||||
| 39 | OMNIABORT => sprintf($path, 'omniabort'), | ||||||||||
| 40 | }; | ||||||||||
| 41 | |||||||||||
| 42 | 1 | my $exports = { | |||||||||
| 43 | any => 'OMNIR OMNIDB OMNISTAT OMNIABORT', | ||||||||||
| 44 | all => 'OMNIR OMNIDB OMNISTAT OMNIABORT', | ||||||||||
| 45 | }; | ||||||||||
| 46 | |||||||||||
| 47 | 1 | class->constant($constants); | |||||||||
| 48 | 1 | class->exports($exports); | |||||||||
| 49 | |||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 1 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||