Skip to content

Commit

Permalink
we get raw bytes for file entities
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbs committed Nov 2, 2009
1 parent 5f43992 commit 4b3a8d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ license = Perl_5
copyright_holder = Ricardo Signes

[Prereq]
autodie = 0 ; minimum?
Archive::Tar = 0
Data::Section = 0 ; technically only needed to test
File::ShareDir = 1 ; look in better places
Expand Down
3 changes: 2 additions & 1 deletion lib/Path/Resolver/Role/FileResolver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package Path::Resolver::Role::FileResolver;
use Moose::Role;
with 'Path::Resolver::Role::Resolver' => { excludes => 'default_converter' };

use autodie;
use namespace::autoclean;

use Path::Resolver::SimpleEntity;
Expand Down Expand Up @@ -35,7 +36,7 @@ my $converter = Path::Resolver::CustomConverter->new({
converter => sub {
my ($converter, $abs_path) = @_;

open my $fh, '<', "$abs_path" or Carp::confess("can't open $abs_path: $!");
open my $fh, '<:raw', "$abs_path";
my $content = do { local $/; <$fh> };
Path::Resolver::SimpleEntity->new({ content_ref => \$content });
},
Expand Down

0 comments on commit 4b3a8d7

Please sign in to comment.