| 1 | package Catalyst::Helper::Graphics; | ||
| 2 | |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '0.1'; | |
| 7 | |||
| 8 | 1 | ▶ | use Catalyst::Helper::Graphics::Files; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | Catalyst::Helper::Graphics | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | script/myapp_create.pl Graphics | ||
| 17 | |||
| 18 | See L<Catalyst::Manual::Intro> for more details | ||
| 19 | |||
| 20 | =head2 METHODS | ||
| 21 | |||
| 22 | =over | ||
| 23 | |||
| 24 | =item mk_stuff | ||
| 25 | |||
| 26 | Creates the individual files. To add another graphic file, place it in the | ||
| 27 | images/ directory and run C<pack_images.pl> to update the auto-generated | ||
| 28 | C<Catalyst::Helper::Graphics::Files>. Make sure to update @images as well. | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | 0 | ▶ | sub mk_stuff { |
|
Subroutine
mk_stuff: not called CC=2 SCAR=17.9
Pod
documented
| |||
| 33 | 0 | my ( $self, $helper, @args ) = @_; | |
| 34 | |||
| 35 | 0 | my @images = qw/cat_loading.gif/; | |
| 36 | 0 | my $image_path = File::Spec->catdir($helper->{base}, 'root', 'static', 'images'); | |
| 37 | |||
| 38 | 0 | for my $name ( @images ) { | |
| 39 | 0 | my $hex = $helper->get_file( | |
| 40 | 'Catalyst::Helper::Graphics::Files', | ||
| 41 | $name ); | ||
| 42 | 0 | my $image = pack "H*", $hex; | |
| 43 | 0 | $helper->mk_file( File::Spec->catfile( $image_path, $name ), | |
| 44 | $image ); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | =head1 AUTHOR | ||
| 49 | |||
| 50 | J. Shirley, <jshirley@gmail.com> | ||
| 51 | |||
| 52 | =head1 LICENSE | ||
| 53 | |||
| 54 | This library is free software, you can redistribute it and/or modify | ||
| 55 | it under the same terms as Perl itself. | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | 1 | 1; | |