| 1 | package CSS::SpriteBuilder::ImageDriver::Auto; | ||||||||||
| 2 | |||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | CSS::SpriteBuilder::ImageDriver::Auto - Class for auto select image manipulation module. | ||||||||||
| 6 | |||||||||||
| 7 | =cut | ||||||||||
| 8 | |||||||||||
| 9 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 4 | our @MODULES = qw(Image::Magick GD); | |||||||||
| 13 | |||||||||||
| 14 | TRY_LOAD: { | ||||||||||
| 15 | 4 | for (@MODULES) { | |||||||||
| 16 | 8 | my $module = $_; | |||||||||
| 17 | 8 | $module =~ s/:://g; | |||||||||
| 18 | 4 | ▶ | eval "use base 'CSS::SpriteBuilder::ImageDriver::$module'"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 8 | ▶ | last TRY_LOAD unless $@; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | } | ||||||||||
| 21 | 4 | warn "You need one of these modules: ". join(', ', @MODULES) .", will use fake-mode."; | |||||||||
| 22 | 4 | ▶ | eval "use base 'CSS::SpriteBuilder::ImageDriver::Fake'"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | }; | ||||||||||
| 24 | |||||||||||
| 25 | 4 | 1; | |||||||||