| 1 | package Catalyst::Helper::Dojo; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Carp qw/ croak /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use HTML::Dojo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | our $VERSION = '0.02000'; | |||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Catalyst::Helper::Dojo - Helper to generate Dojo JavaScript / AJAX library | ||||||||||
| 13 | |||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||
| 15 | |||||||||||
| 16 | script/myapp_create.pl Dojo edition | ||||||||||
| 17 | # where "edition" is the edition name you want to install | ||||||||||
| 18 | |||||||||||
| 19 | See L<HTML::Dojo> for a list of available editions. | ||||||||||
| 20 | |||||||||||
| 21 | =head1 DESCRIPTION | ||||||||||
| 22 | |||||||||||
| 23 | Helper to generate Dojo JavaScript / AJAX library. | ||||||||||
| 24 | |||||||||||
| 25 | =head2 METHODS | ||||||||||
| 26 | |||||||||||
| 27 | =over 4 | ||||||||||
| 28 | |||||||||||
| 29 | =item mk_stuff | ||||||||||
| 30 | |||||||||||
| 31 | Create javascript files for Dojo in your application's C<root/static/dojo> | ||||||||||
| 32 | directory. | ||||||||||
| 33 | |||||||||||
| 34 | =back | ||||||||||
| 35 | |||||||||||
| 36 | =cut | ||||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | sub mk_stuff { | ||||||||
|
Subroutine
mk_stuff: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 39 | 0 | my ( $self, $helper, $edition ) = @_; | |||||||||
| 40 | |||||||||||
| 41 | 0 | my %args; | |||||||||
| 42 | 0 | ▶ | $args{edition} = $edition if defined $edition; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | |||||||||||
| 44 | 0 | my $dojo = HTML::Dojo->new( %args ); | |||||||||
| 45 | |||||||||||
| 46 | 0 | my $dirs = $dojo->list({ | |||||||||
| 47 | directories => 1, | ||||||||||
| 48 | files => 0, | ||||||||||
| 49 | }); | ||||||||||
| 50 | |||||||||||
| 51 | my $dojo_dir = File::Spec->catdir( | ||||||||||
| 52 | 0 | $helper->{base}, 'root', 'static', 'dojo' ); | |||||||||
| 53 | |||||||||||
| 54 | 0 | for (@$dirs) { | |||||||||
| 55 | 0 | my $dir = File::Spec->catdir( $dojo_dir, $_ ); | |||||||||
| 56 | |||||||||||
| 57 | 0 | $helper->mk_dir( $dir ); | |||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | 0 | my $files = $dojo->list; | |||||||||
| 61 | |||||||||||
| 62 | 0 | for (@$files) { | |||||||||
| 63 | 0 | my $file = File::Spec->catfile( $dojo_dir, $_ ); | |||||||||
| 64 | |||||||||||
| 65 | 0 | $helper->mk_file( $file, $dojo->file($_) ); | |||||||||
| 66 | } | ||||||||||
| 67 | 0 | return; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | =head1 SUPPORT | ||||||||||
| 71 | |||||||||||
| 72 | IRC: | ||||||||||
| 73 | |||||||||||
| 74 | Join #catalyst on irc.perl.org. | ||||||||||
| 75 | |||||||||||
| 76 | Mailing Lists: | ||||||||||
| 77 | |||||||||||
| 78 | http://lists.rawmode.org/mailman/listinfo/catalyst | ||||||||||
| 79 | |||||||||||
| 80 | For Dojo-specific support, see L<http://dojotoolkit.org>. | ||||||||||
| 81 | |||||||||||
| 82 | =head1 SEE ALSO | ||||||||||
| 83 | |||||||||||
| 84 | L<HTML::Dojo>, L<Catalyst::Helper> | ||||||||||
| 85 | |||||||||||
| 86 | L<http://dojotoolkit.org> | ||||||||||
| 87 | |||||||||||
| 88 | =head1 AUTHOR | ||||||||||
| 89 | |||||||||||
| 90 | Carl Franks, C<cfranks@cpan.org> | ||||||||||
| 91 | |||||||||||
| 92 | =head1 LICENSE | ||||||||||
| 93 | |||||||||||
| 94 | This library is free software . You can redistribute it and/or modify | ||||||||||
| 95 | it under the same terms as perl itself. | ||||||||||
| 96 | |||||||||||
| 97 | =cut | ||||||||||
| 98 | |||||||||||
| 99 | 1 | 1; | |||||||||