CGI-Application-Dispatch-Server

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

use Module::Build;

use strict;

my $build = Module::Build->new(
    module_name => 'CGI::Application::Dispatch::Server',
    license => 'perl',
    requires => {
        'Scalar::Util'  => '1.18',
        'Carp'          => '0.01',
        'HTTP::Request' => '0',
        'HTTP::Status'  => '0',
        'IO::Capture::Stdout'          => '0',
        'CGI::Application'             => '0',
        'CGI::Application::Dispatch'   => '0',
        'HTTP::Server::Simple'         => '0.18',
        'HTTP::Server::Simple::Static' => '0.02',
        'HTTP::Server::Simple::CGI'    => 0,
        'Params::Validate'             => 0, 
    },
    optional => {

META.yml  view on Meta::CPAN

  version: 1.4
name: CGI-Application-Dispatch-Server
provides:
  CGI::Application::Dispatch::Server:
    file: lib/CGI/Application/Dispatch/Server.pm
    version: 0.53
requires:
  CGI::Application: 0
  CGI::Application::Dispatch: 0
  Carp: 0.01
  HTTP::Request: 0
  HTTP::Server::Simple: 0.18
  HTTP::Server::Simple::CGI: 0
  HTTP::Server::Simple::Static: 0.02
  HTTP::Status: 0
  IO::Capture::Stdout: 0
  Params::Validate: 0
  Scalar::Util: 1.18
resources:
  license: http://dev.perl.org/licenses/
version: 0.53

Makefile.PL  view on Meta::CPAN

# Note: this file was auto-generated by Module::Build::Compat version 0.3601
use ExtUtils::MakeMaker;
WriteMakefile
(
          'NAME' => 'CGI::Application::Dispatch::Server',
          'VERSION_FROM' => 'lib/CGI/Application/Dispatch/Server.pm',
          'PREREQ_PM' => {
                           'CGI::Application' => '0',
                           'CGI::Application::Dispatch' => '0',
                           'Carp' => '0.01',
                           'HTTP::Request' => '0',
                           'HTTP::Server::Simple' => '0.18',
                           'HTTP::Server::Simple::CGI' => 0,
                           'HTTP::Server::Simple::Static' => '0.02',
                           'HTTP::Status' => '0',
                           'IO::Capture::Stdout' => '0',
                           'Params::Validate' => 0,
                           'Scalar::Util' => '1.18',
                           'Test::More' => '0.47'
                         },
          'INSTALLDIRS' => 'site',

README  view on Meta::CPAN


   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:

    HTTP::Request
    HTTP::Status
    IO::Capture::Stdout
    CGI::Application
    HTTP::Server::Simple
    HTTP::Server::Simple::Static
    HTTP::Server::Simple::CGI

And requires these modules for testing:

    Test::More

lib/CGI/Application/Dispatch/Server.pm  view on Meta::CPAN

    $capture->start;
    CGI::Application::Dispatch->dispatch(%{$self->{dispatch_args}});
    $capture->stop;
    my $stdout = join "\x0d\x0a", $capture->read;
    my $response = $self->_build_response( $stdout );
    print $response->as_string;
  }

}

# Shamelessly stolen from HTTP::Request::AsCGI by chansen
sub _build_response {
    my ( $self, $stdout ) = @_;

    $stdout =~ s{(.*?\x0d?\x0a\x0d?\x0a)}{}xsm;
    my $headers = $1;

    unless ( defined $headers ) {
        $headers = "HTTP/1.1 500 Internal Server Error\x0d\x0a";
    }

lib/CGI/Application/Dispatch/Server.pm  view on Meta::CPAN


=head1 BUGS

If you are not sure the behavior is a bug, please discuss it on the 
cgiapp mailing list ( cgiapp@lists.erlbaum.net ). If you feel certain
if you have found a bug, please report it through rt.cpan.org. 

=head1 ACKNOWLEDGEMENTS

This module was cloned from L<CGI::Application::Server|CGI::Application::Server>, which in turn 
borrowed significant parts from L<HTTP::Request::AsCGI|HTTP::Requeste::AsCGI>.

=head1 CONTRIBUTORS

George Hartzell E<lt>hartzell@alerce.comE<gt> 
Mark Stosberg

=head1 COPYRIGHT AND LICENSE

Copyright 2006 by George Hartzell



( run in 0.296 second using v1.01-cache-2.11-cpan-de7293f3b23 )