[Catalyst-commits] r10318 - in
Catalyst-Devel/1.00/branches/helper_refactor: . lib/Catalyst
share share/root
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Wed May 27 20:07:17 GMT 2009
Author: t0m
Date: 2009-05-27 20:07:17 +0000 (Wed, 27 May 2009)
New Revision: 10318
Added:
Catalyst-Devel/1.00/branches/helper_refactor/share/root/
Catalyst-Devel/1.00/branches/helper_refactor/share/root/favicon.ico
Modified:
Catalyst-Devel/1.00/branches/helper_refactor/Makefile.PL
Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
Log:
Make the favicon be in the sharedir
Modified: Catalyst-Devel/1.00/branches/helper_refactor/Makefile.PL
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/Makefile.PL 2009-05-27 19:51:45 UTC (rev 10317)
+++ Catalyst-Devel/1.00/branches/helper_refactor/Makefile.PL 2009-05-27 20:07:17 UTC (rev 10318)
@@ -17,6 +17,8 @@
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.
Modified: Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm 2009-05-27 19:51:45 UTC (rev 10317)
+++ Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm 2009-05-27 20:07:17 UTC (rev 10318)
@@ -13,6 +13,8 @@
use Catalyst::Devel;
use Catalyst::Utils;
use Catalyst::Exception;
+use Path::Class qw/dir file/;
+use File::ShareDir qw/dist_dir/;
my %cache;
@@ -26,6 +28,14 @@
=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} ) {
@@ -430,9 +440,9 @@
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 );
}
Added: Catalyst-Devel/1.00/branches/helper_refactor/share/root/favicon.ico
===================================================================
(Binary files differ)
Property changes on: Catalyst-Devel/1.00/branches/helper_refactor/share/root/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the Catalyst-commits
mailing list