Skip to content
Browse files

Add POE::Test::Loops to config_requires, so modern systems can install

it before Makefile.PL runs.  Allow gen-tests.pl to fail gracefully if
POE::Test::Loops isn't installed.  Remove a bunch of tabs from
unrelated files.
  • Loading branch information...
1 parent a6f6333 commit 6cae398d8a8ebc7b0b2944f292479efc64c34e6e @rcaputo committed Jul 5, 2008
View
12 docs/Makefile
@@ -5,13 +5,13 @@
all: ../POE.pod ../POE-TODO.pod ../POE-HINTS.pod
../POE.pod: ./POE.outline
- ./out-out.perl pod ./POE.outline > ../POE.pod
- ./out-out.perl html ./POE.outline > ../POE.html
+ ./out-out.perl pod ./POE.outline > ../POE.pod
+ ./out-out.perl html ./POE.outline > ../POE.html
../POE-TODO.pod: ./POE-TODO.outline
- ./out-out.perl pod ./POE-TODO.outline > ../POE-TODO.pod
- ./out-out.perl html ./POE-TODO.outline > ../POE-TODO.html
+ ./out-out.perl pod ./POE-TODO.outline > ../POE-TODO.pod
+ ./out-out.perl html ./POE-TODO.outline > ../POE-TODO.html
../POE-HINTS.pod: ./POE-HINTS.outline
- ./out-out.perl pod ./POE-HINTS.outline > ../POE-HINTS.pod
- ./out-out.perl html ./POE-HINTS.outline > ../POE-HINTS.html
+ ./out-out.perl pod ./POE-HINTS.outline > ../POE-HINTS.pod
+ ./out-out.perl html ./POE-HINTS.outline > ../POE-HINTS.html
View
2 lib/POE.pm
@@ -7,7 +7,7 @@ use strict;
use Carp qw( croak );
use vars qw($VERSION $REVISION);
-$VERSION = '1.001'; # NOTE - Should be #.### (three decimal places)
+$VERSION = '1.002'; # NOTE - Should be #.### (three decimal places)
$REVISION = do {my($r)=(q$Revision$=~/(\d+)/);sprintf"1.%04d",$r};
sub import {
View
82 lib/POE/Filter/HTTPD.pm
@@ -386,55 +386,55 @@ POE::Filter::HTTPD - parse simple HTTP requests, and serialize HTTP::Response
=head1 SYNOPSIS
- #!perl
+ #!perl
- use warnings;
- use strict;
+ use warnings;
+ use strict;
- use POE qw(Component::Server::TCP Filter::HTTPD);
- use HTTP::Response;
+ use POE qw(Component::Server::TCP Filter::HTTPD);
+ use HTTP::Response;
- POE::Component::Server::TCP->new(
- Port => 8088,
- ClientFilter => 'POE::Filter::HTTPD', ### <-- HERE WE ARE!
+ POE::Component::Server::TCP->new(
+ Port => 8088,
+ ClientFilter => 'POE::Filter::HTTPD', ### <-- HERE WE ARE!
- ClientInput => sub {
- my $request = $_[ARG0];
+ ClientInput => sub {
+ my $request = $_[ARG0];
- # It's a response for the client if there was a problem.
- if ($request->isa("HTTP::Response")) {
- $_[HEAP]{client}->put($request);
- $_[KERNEL]->yield("shutdown");
- return;
- }
+ # It's a response for the client if there was a problem.
+ if ($request->isa("HTTP::Response")) {
+ $_[HEAP]{client}->put($request);
+ $_[KERNEL]->yield("shutdown");
+ return;
+ }
- my $request_fields = '';
- $request->headers()->scan(
- sub {
- my ($header, $value) = @_;
- $request_fields .= (
+ my $request_fields = '';
+ $request->headers()->scan(
+ sub {
+ my ($header, $value) = @_;
+ $request_fields .= (
"<tr><td>$header</td><td>$value</td></tr>"
);
- }
- );
-
- my $response = HTTP::Response->new(200);
- $response->push_header( 'Content-type', 'text/html' );
- $response->content(
- "<html><head><title>Your Request</title></head>" .
- "<body>Details about your request:" .
- "<table border='1'>$request_fields</table>" .
- "</body></html>"
- );
-
- $_[HEAP]{client}->put($response);
- $_[KERNEL]->yield("shutdown");
- }
- );
-
- print "Aim your browser at port 8088 of this host.\n";
- POE::Kernel->run();
- exit;
+ }
+ );
+
+ my $response = HTTP::Response->new(200);
+ $response->push_header( 'Content-type', 'text/html' );
+ $response->content(
+ "<html><head><title>Your Request</title></head>" .
+ "<body>Details about your request:" .
+ "<table border='1'>$request_fields</table>" .
+ "</body></html>"
+ );
+
+ $_[HEAP]{client}->put($response);
+ $_[KERNEL]->yield("shutdown");
+ }
+ );
+
+ print "Aim your browser at port 8088 of this host.\n";
+ POE::Kernel->run();
+ exit;
=head1 DESCRIPTION
View
4 lib/POE/Filter/Reference.pm
@@ -257,8 +257,8 @@ POE::Filter::Reference - freeze and thaw arbitrary Perl data
},
got_perl_data => sub {
print "Got data:\n", YAML::Dump($_[ARG0]);
- print "Bye!\n";
- delete $_[HEAP]{io};
+ print "Bye!\n";
+ delete $_[HEAP]{io};
}
}
);
View
4 lib/POE/NFA.pm
@@ -785,9 +785,9 @@ POE::NFA - an event-driven state machine (nondeterministic finite automaton)
$_[RUNSTATE]{io}->put('Bye!');
$_[MACHINE]->stop();
}
- else {
+ else {
$_[MACHINE]->goto_state(state_cmd => "on_entry");
- }
+ }
}
=head1 DESCRIPTION
View
76 lib/POE/Wheel/ReadLine.pm
@@ -3065,51 +3065,51 @@ POE::Wheel::ReadLine - non-blocking Term::ReadLine for POE
=head1 SYNOPSIS
- #!perl
+ #!perl
- use warnings;
- use strict;
+ use warnings;
+ use strict;
- use POE qw(Wheel::ReadLine);
+ use POE qw(Wheel::ReadLine);
- POE::Session->create(
- inline_states=> {
- _start => \&setup_console,
- got_user_input => \&handle_user_input,
- }
- );
+ POE::Session->create(
+ inline_states=> {
+ _start => \&setup_console,
+ got_user_input => \&handle_user_input,
+ }
+ );
- POE::Kernel->run();
- exit;
+ POE::Kernel->run();
+ exit;
- sub handle_user_input {
- my ($input, $exception) = @_[ARG0, ARG1];
- my $console = $_[HEAP]{console};
+ sub handle_user_input {
+ my ($input, $exception) = @_[ARG0, ARG1];
+ my $console = $_[HEAP]{console};
- unless (defined $input) {
- $console->put("$exception caught. B'bye!");
+ unless (defined $input) {
+ $console->put("$exception caught. B'bye!");
$_[KERNEL]->signal($_[KERNEL], "UIDESTROY");
- $console->write_history("./test_history");
- return;
- }
-
- $console->put(" You entered: $input");
- $console->addhistory($input);
- $console->get("Go: ");
- }
-
- sub setup_console {
- $_[HEAP]{console} = POE::Wheel::ReadLine->new(
- InputEvent => 'got_user_input'
- );
- $_[HEAP]{console}->read_history("./test_history");
- $_[HEAP]{console}->clear();
- $_[HEAP]{console}->put(
- "Enter some text.",
- "Ctrl+C or Ctrl+D exits."
- );
- $_[HEAP]{console}->get("Go: ");
- }
+ $console->write_history("./test_history");
+ return;
+ }
+
+ $console->put(" You entered: $input");
+ $console->addhistory($input);
+ $console->get("Go: ");
+ }
+
+ sub setup_console {
+ $_[HEAP]{console} = POE::Wheel::ReadLine->new(
+ InputEvent => 'got_user_input'
+ );
+ $_[HEAP]{console}->read_history("./test_history");
+ $_[HEAP]{console}->clear();
+ $_[HEAP]{console}->put(
+ "Enter some text.",
+ "Ctrl+C or Ctrl+D exits."
+ );
+ $_[HEAP]{console}->get("Go: ");
+ }
=head1 DESCRIPTION
View
1 mylib/Makefile-5004.pm
@@ -1,5 +1,6 @@
#!/usr/bin/perl
# $Id$
+# rocco // vim: ts=2 sw=2 expandtab
use strict;
View
1 mylib/Makefile-5005.pm
@@ -1,5 +1,6 @@
#!/usr/bin/perl
# $Id$
+# rocco // vim: ts=2 sw=2 expandtab
use strict;
View
24 mylib/PoeBuildInfo.pm
@@ -1,4 +1,5 @@
# $Id$
+# rocco // vim: ts=2 sw=2 expandtab
# Build information for POE. Moved into a library so it can be
# required by Makefile.PL and gen-meta.perl.
@@ -18,8 +19,16 @@ use vars qw(@EXPORT_OK);
DIST_ABSTRACT
DIST_AUTHOR
RECOMMENDED_TIME_HIRES
+ CONFIG_REQUIREMENTS
);
+
+sub CONFIG_REQUIREMENTS () {
+ (
+ "POE::Test::Loops" => 1.002,
+ )
+}
+
sub CORE_REQUIREMENTS () {
(
"Carp" => 0,
@@ -31,7 +40,6 @@ sub CORE_REQUIREMENTS () {
"Socket" => 1.7,
"Test::Harness" => 2.26,
"Storable" => 2.16,
- "POE::Test::Loops" => 1.002,
(
($^O eq "MSWin32")
? (
@@ -40,6 +48,7 @@ sub CORE_REQUIREMENTS () {
)
: ()
),
+ CONFIG_REQUIREMENTS,
)
}
@@ -66,16 +75,9 @@ sub CLEAN_FILES () {
t/20_resources/10_perl/*
t/20_resources/20_xs
t/20_resources/20_xs/*
- t/30_loops/select
- t/30_loops/select/*
- t/30_loops/io_poll
- t/30_loops/io_poll/*
- t/30_loops/event
- t/30_loops/event/*
- t/30_loops/gtk
- t/30_loops/gtk/*
- t/30_loops/tk
- t/30_loops/tk/*
+ t/30_loops/*/*
+ t/30_loops/*
+ t/30_loops
);
"@clean_files";
}
View
2 mylib/gen-meta.perl
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w
# $Id$
+# rocco // vim: ts=2 sw=2 expandtab
# Generate META.yml.
@@ -24,6 +25,7 @@
RECOMMENDED_TIME_HIRES,
},
requires => { CORE_REQUIREMENTS },
+ config_requires => { CONFIG_REQUIREMENTS },
no_index => {
directory => [ "mylib", "t" ]
},
View
11 mylib/gen-tests.perl
@@ -1,9 +1,18 @@
#!/usr/bin/perl -w
+# $Id$
+# rocco // vim: ts=2 sw=2 expandtab
use strict;
use File::Spec;
use File::Path;
-use POE::Test::Loops;
+
+BEGIN {
+ eval "require POE::Test::Loops";
+ if ($@) {
+ warn "Could not load POE::Test::Loops. Skipping loop tests";
+ exit;
+ }
+}
my $test_base = "t";
View
14 mylib/preprocessor.perl
@@ -4,11 +4,11 @@
use strict;
while (<STDIN>) {
- if ($] < 5.006) {
- s/^(\s*)(use bytes;).*/$1#$2 # perl version $] at install/;
- }
- else {
- s/^(\s*)#\s*(use bytes;).*/$1$2/;
- }
- print;
+ if ($] < 5.006) {
+ s/^(\s*)(use bytes;).*/$1#$2 # perl version $] at install/;
+ }
+ else {
+ s/^(\s*)#\s*(use bytes;).*/$1$2/;
+ }
+ print;
}

0 comments on commit 6cae398

Please sign in to comment.
Something went wrong with that request. Please try again.