Resource::Pack

Tools for managing application resources
Download

Resource::Pack Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Jesse Luehrs
  • Publisher web site:
  • http://search.cpan.org/~doy/

Resource::Pack Tags


Resource::Pack Description

Tools for managing application resources The Resource::Pack module is a set of Moose classes, built on top of Bread::Board, designed to allow managing non-Perl resources in a very CPAN friendly way.In the past if you wanted to distribute your non-Perl code via CPAN there were a number of less then ideal ways to do it. The simplest was to store the data in Perl strings or encoded as binary data; this is ugly to say the least. You could also use a module like File::ShareDir, which relies on the fact that CPAN can be told to install files inside a directory called share. This technique is both reliable and comes with a decent set of tools to make accessing these files pretty simple and easy. And lastly there are tools like JS, which installs js-cpan, and exploits the fact that CPAN will also install non-Perl files it finds inside lib alongside your regular Perl files.So, what does Resource::Pack provide beyond these tools? Mostly it provides a framework which you can use to inspect and manipulate these non-Perl files, and most importantly it provides dependency management. Resource::Pack also can depend on files out on the internet as well and deal with them in the same way as it does local files.So, this is all the docs I have for now, but more will come soon. This is an early release of this module so it should still be considered experimental and so used with caution. As always the best docs are probably the test files.SYNOPSIS my $resources = resource my_app => as { install_from 'data'; install_to '/var/www/site'; url jquery => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'; file app_js => 'app.js'; file app_css => ( file => 'app.css', install_to => 'css', ); dir 'images'; }; $resources->install;or, to package this up nicely in a class: package My::App::Resources; use Moose; use Resource::Pack; extends 'Resource::Pack::Resource'; has '+name' => (default => 'my_app'); sub BUILD { my $self = shift; resource $self => as { install_from 'data'; url jquery => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'; file app_js => 'app.js'; file app_css => ( file => 'app.css', install_to => 'css', ); dir 'images'; }; } my $resources = My::App::Resources->new(install_to => '/var/www/site'); $resources->install; Requirements: · Perl


Resource::Pack Related Software