Skip to content

Commit

Permalink
removed IO::File dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dann committed Jan 17, 2009
1 parent 7ffbb6f commit f51219f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions angelos-core/Makefile.PL
Expand Up @@ -78,6 +78,9 @@ requires 'Term::ReadLine';
requires 'JSON::XS'; requires 'JSON::XS';
requires 'MIME::Types'; requires 'MIME::Types';


# Middleware
requires 'File::stat';

if (HAVE_MP) { if (HAVE_MP) {
Apache::TestMM::filter_args(); Apache::TestMM::filter_args();
#Apache::TestMM::generate_script('t/integration/modperl/TEST'); #Apache::TestMM::generate_script('t/integration/modperl/TEST');
Expand Down
Expand Up @@ -5,8 +5,8 @@ type: :task
component: middleware component: middleware
release: "0.01" release: "0.01"
reporter: dann <techmemo@gmail.com> reporter: dann <techmemo@gmail.com>
status: :unstarted status: :closed
disposition: disposition: :fixed
creation_time: 2009-01-14 15:29:13.497768 Z creation_time: 2009-01-14 15:29:13.497768 Z
references: [] references: []


Expand All @@ -16,3 +16,7 @@ log_events:
- dann <techmemo@gmail.com> - dann <techmemo@gmail.com>
- created - created
- "" - ""
- - 2009-01-17 17:17:48.462601 Z
- dann <techmemo@gmail.com>
- closed with disposition fixed
- ""
7 changes: 4 additions & 3 deletions angelos-core/lib/Angelos/Middleware/Static.pm
Expand Up @@ -5,7 +5,7 @@ extends 'Angelos::Middleware';
use Angelos::Exceptions; use Angelos::Exceptions;
use HTTP::Engine::Response; use HTTP::Engine::Response;
use Angelos::MIMETypes; use Angelos::MIMETypes;
use IO::File; use Path::Class;
use Angelos::Home; use Angelos::Home;
use File::stat; use File::stat;


Expand Down Expand Up @@ -68,9 +68,8 @@ sub serve_static {
$res->header( 'Content-Length' => $stat->size ); $res->header( 'Content-Length' => $stat->size );
$res->header( 'Last-Modified' => $stat->mtime ); $res->header( 'Last-Modified' => $stat->mtime );


my $fh = IO::File->new( $full_path, 'r' ); my $fh = $full_path->openr;
if ( defined $fh ) { if ( defined $fh ) {
warn 'hoge';
binmode $fh; binmode $fh;
$res->code(200); $res->code(200);
$res->body($fh); $res->body($fh);
Expand Down Expand Up @@ -101,3 +100,5 @@ sub _extension_to_type {
} }


__END_OF_CLASS__ __END_OF_CLASS__

__END__

0 comments on commit f51219f

Please sign in to comment.