requires 'Path::Class' => '0.09';
requires 'Template' => '2.14';
+install_share 'share';
+
if ( $^O eq 'MSWin32' ) {
# Proc::Background needs this on Win32 but doesn't actually
# require it, if it's missing it just dies in the Makefile.PL.
use Catalyst::Devel;
use Catalyst::Utils;
use Catalyst::Exception;
+use Path::Class qw/dir file/;
+use File::ShareDir qw/dist_dir/;
my %cache;
=cut
+sub get_sharedir_file {
+ my ($self, @filename) = @_;
+ my $file = file( dist_dir('Catalyst-Devel'), @filename);
+ warn $file;
+ my $contents = $file->slurp;
+ return $contents;
+}
+
sub get_file {
my ( $self, $class, $file ) = @_;
unless ( $cache{$class} ) {
sub _mk_favicon {
my $self = shift;
my $root = $self->{root};
- my $hex = $self->get_file( ( caller(0) )[0], 'favicon' );
- my $favicon = pack "H*", $hex;
- $self->mk_file( File::Spec->catfile( $root, "favicon.ico" ), $favicon );
+ my $favicon = $self->get_sharedir_file( 'root', 'favicon.ico' );
+ my $dest = File::Spec->catfile( $root, "favicon.ico" );
+ $self->mk_file( $dest, $favicon );
}