From 4984624cf2e810bfe95a013fd9ae79e26ef3e5fc Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 13 Mar 2012 02:32:44 +0100 Subject: [PATCH 1/1] Upgrade HTTP::Tiny to 0.017. --- Porting/Maintainers.pl | 2 +- cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 42 ++++++++++++++++++++++++----------------- cpan/HTTP-Tiny/perlcritic.rc | 23 ++++++++++++++++++++++ cpan/HTTP-Tiny/t/00-compile.t | 22 +++++++++++++++++---- 4 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 cpan/HTTP-Tiny/perlcritic.rc diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 4641176..3421f6a 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 c9a2dca..46dce74 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 A user-agent string (defaults to 'HTTP::Tiny/$VERSION') =item * -default_headers +C A hashref of default headers to apply to requests =item * -max_redirect +C Maximum number of redirects allowed (defaults to 5) =item * -max_size +C 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 URL of a proxy server to use (default is C<$ENV{http_proxy}> if set) =item * -timeout +C Request timeout in seconds (default is 60) =back +Exceptions from C, C 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 for the given method. The URL must have unsafe characters escaped and international domain names encoded. See C for valid options and a description of the response. +The C 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 for valid options and a description of the response. Any C header or content in the options hashref will be ignored. +The C 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 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 header with the modification timestamp of the file. You -may specificy a different C header yourself in the C<< +may specify a different C header yourself in the C<< $options->{headers} >> hash. The C 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 header, the file modification time will @@ -1168,9 +1176,9 @@ L =head2 Bugs / Feature Requests -Please report any bugs or feature requests by email to C, or through -the web interface at L. 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. +You will be notified automatically of any progress on your issue. =head2 Source Code @@ -1197,7 +1205,7 @@ David Golden =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 0000000..c8f9a90 --- /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 6ce3690..6987686 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"); -- 1.8.3.1