summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2012-03-13 02:32:44 +0100
committerAbigail <abigail@abigail.be>2012-03-13 02:32:44 +0100
commit4984624cf2e810bfe95a013fd9ae79e26ef3e5fc (patch)
treeec50e7fd0ab9a93889959d33d193ca51f38af195
parentadcd8125fe0adb4fcdd1607acd5a30f364a43564 (diff)
downloadperl-4984624cf2e810bfe95a013fd9ae79e26ef3e5fc.tar.gz
Upgrade HTTP::Tiny to 0.017.
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/HTTP-Tiny/lib/HTTP/Tiny.pm42
-rw-r--r--cpan/HTTP-Tiny/perlcritic.rc23
-rw-r--r--cpan/HTTP-Tiny/t/00-compile.t22
4 files changed, 67 insertions, 22 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 4641176834..3421f6a2d0 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -955,7 +955,7 @@ use File::Glob qw(:case);
'HTTP::Tiny' => {
'MAINTAINER' => 'dagolden',
- 'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.016.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.017.tar.gz',
'FILES' => q[cpan/HTTP-Tiny],
'EXCLUDED' => [
't/200_live.t',
diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
index c9a2dcaec2..46dce742e3 100644
--- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
+++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
@@ -3,7 +3,7 @@ package HTTP::Tiny;
use strict;
use warnings;
# ABSTRACT: A small, simple, correct HTTP/1.1 client
-our $VERSION = '0.016'; # VERSION
+our $VERSION = '0.017'; # VERSION
use Carp ();
@@ -48,7 +48,7 @@ sub new {
for my $sub_name ( qw/get head put post delete/ ) {
my $req_method = uc $sub_name;
no strict 'refs';
- eval <<"HERE";
+ eval <<"HERE"; ## no critic
sub $sub_name {
my (\$self, \$url, \$args) = \@_;
\@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
@@ -382,7 +382,7 @@ use warnings;
use Errno qw[EINTR EPIPE];
use IO::Socket qw[SOCK_STREAM];
-sub BUFSIZE () { 32768 }
+sub BUFSIZE () { 32768 } ## no critic
my $Printable = sub {
local $_ = shift;
@@ -840,7 +840,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client
=head1 VERSION
-version 0.016
+version 0.017
=head1 SYNOPSIS
@@ -881,43 +881,47 @@ This constructor returns a new HTTP::Tiny object. Valid attributes include:
=item *
-agent
+C<agent>
A user-agent string (defaults to 'HTTP::Tiny/$VERSION')
=item *
-default_headers
+C<default_headers>
A hashref of default headers to apply to requests
=item *
-max_redirect
+C<max_redirect>
Maximum number of redirects allowed (defaults to 5)
=item *
-max_size
+C<max_size>
Maximum response size (only when not using a data callback). If defined,
-responses larger than this will die with an error message
+responses larger than this will return an exception.
=item *
-proxy
+C<proxy>
URL of a proxy server to use (default is C<$ENV{http_proxy}> if set)
=item *
-timeout
+C<timeout>
Request timeout in seconds (default is 60)
=back
+Exceptions from C<max_size>, C<timeout> or other errors will result in a
+pseudo-HTTP status code of 599 and a reason of "Internal Exception". The
+content field in the response will contain the text of the exception.
+
=head2 get|head|put|post|delete
$response = $http->get($url);
@@ -928,6 +932,8 @@ These methods are shorthand for calling C<request()> for the given method. The
URL must have unsafe characters escaped and international domain names encoded.
See C<request()> for valid options and a description of the response.
+The C<success> field of the response will be true if the status code is 2XX.
+
=head2 post_form
$response = $http->post_form($url, $form_data);
@@ -942,6 +948,8 @@ The URL must have unsafe characters escaped and international domain names
encoded. See C<request()> for valid options and a description of the response.
Any C<content-type> header or content in the options hashref will be ignored.
+The C<success> field of the response will be true if the status code is 2XX.
+
=head2 mirror
$response = $http->mirror($url, $file, \%options)
@@ -953,11 +961,11 @@ Executes a C<GET> request for the URL and saves the response body to the file
name provided. The URL must have unsafe characters escaped and international
domain names encoded. If the file already exists, the request will includes an
C<If-Modified-Since> header with the modification timestamp of the file. You
-may specificy a different C<If-Modified-Since> header yourself in the C<<
+may specify a different C<If-Modified-Since> header yourself in the C<<
$options->{headers} >> hash.
The C<success> field of the response will be true if the status code is 2XX
-or 304 (unmodified).
+or if the status code is 304 (unmodified).
If the file was modified and the server response includes a properly
formatted C<Last-Modified> header, the file modification time will
@@ -1168,9 +1176,9 @@ L<LWP::UserAgent>
=head2 Bugs / Feature Requests
-Please report any bugs or feature requests by email to C<bug-http-tiny at rt.cpan.org>, or through
-the web interface at L<http://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Tiny>. You will be automatically notified of any
-progress on the request by the system.
+Please report any bugs or feature requests through the issue tracker
+at L<http://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Tiny>.
+You will be notified automatically of any progress on your issue.
=head2 Source Code
@@ -1197,7 +1205,7 @@ David Golden <dagolden@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2011 by Christian Hansen.
+This software is copyright (c) 2012 by Christian Hansen.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/cpan/HTTP-Tiny/perlcritic.rc b/cpan/HTTP-Tiny/perlcritic.rc
new file mode 100644
index 0000000000..c8f9a90473
--- /dev/null
+++ b/cpan/HTTP-Tiny/perlcritic.rc
@@ -0,0 +1,23 @@
+severity = 5
+verbose = 8
+
+[Variables::ProhibitPunctuationVars]
+allow = $@ $!
+
+[TestingAndDebugging::ProhibitNoStrict]
+allow = refs
+
+# Turn these off
+[-BuiltinFunctions::ProhibitStringyEval]
+[-ControlStructures::ProhibitPostfixControls]
+[-ControlStructures::ProhibitUnlessBlocks]
+[-Documentation::RequirePodSections]
+[-InputOutput::ProhibitInteractiveTest]
+[-Miscellanea::RequireRcsKeywords]
+[-References::ProhibitDoubleSigils]
+[-RegularExpressions::RequireExtendedFormatting]
+[-InputOutput::ProhibitTwoArgOpen]
+
+# Turn this on
+[Lax::ProhibitStringyEval::ExceptForRequire]
+
diff --git a/cpan/HTTP-Tiny/t/00-compile.t b/cpan/HTTP-Tiny/t/00-compile.t
index 6ce3690f2f..698768633c 100644
--- a/cpan/HTTP-Tiny/t/00-compile.t
+++ b/cpan/HTTP-Tiny/t/00-compile.t
@@ -24,19 +24,33 @@ find(
'lib',
);
-my @scripts;
-if ( -d 'bin' ) {
+sub _find_scripts {
+ my $dir = shift @_;
+
+ my @found_scripts = ();
find(
sub {
return unless -f;
my $found = $File::Find::name;
# nothing to skip
- push @scripts, $found;
+ open my $FH, '<', $_ or do {
+ note( "Unable to open $found in ( $! ), skipping" );
+ return;
+ };
+ my $shebang = <$FH>;
+ return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
+ push @found_scripts, $found;
},
- 'bin',
+ $dir,
);
+
+ return @found_scripts;
}
+my @scripts;
+do { push @scripts, _find_scripts($_) if -d $_ }
+ for qw{ bin script scripts };
+
my $plan = scalar(@modules) + scalar(@scripts);
$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");