Commit 8f9df2ed authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 0.036

parent d43119a2
README.PATCHING
## HOW TO CONTRIBUTE
Thank you for considering contributing to this distribution. This file
contains instructions that will help you work with the source code.
......@@ -7,36 +7,64 @@ The distribution is managed with Dist::Zilla. This means than many of the
usual files you might expect are not in the repository, but are generated
at release time (e.g. Makefile.PL).
However, you can run tests directly using the 'prove' tool:
### Getting dependencies
$ prove -l
$ prove -lv t/some_test_file.t
See the included `cpanfile` file for a list of dependencies. If you have
App::cpanminus 1.6 or later installed, you can use `cpanm` to satisfy
dependencies like this:
For most distributions, 'prove' is entirely sufficent for you to test any
$ cpanm --installdeps .
Otherwise, you can install Module::CPANfile 1.0002 or later and then satisfy
dependencies with the regular `cpan` client and `cpanfile-dump`:
$ cpan `cpanfile-dump`
### Running tests
You can run tests directly using the `prove` tool:
$ prove -l
$ prove -lv t/some_test_file.t
For most distributions, `prove` is entirely sufficent for you to test any
patches you have.
Likewise, much of the documentation Pod is generated at release time.
### Code style and tidying
Please try to match any existing coding style. If there is a `.perltidyrc`
file, please install Perl::Tidy and use perltidy before submitting patches.
If there is a `tidyall.ini` file, you can also install Code::TidyAll and run
`tidyall` on a file or `tidyall -a` to tidy all files.
### Patching documentation
Much of the documentation Pod is generated at release time.
Depending on the distribution, some documentation may be written in a Pod
dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to
submit a documentation edit, please limit yourself to the documentation you
see.
dialect called WikiDoc. (See Pod::WikiDoc on CPAN.)
If you would like to submit a documentation edit, please limit yourself to the
documentation you see.
If you see typos or documentation issues in the generated docs, please
email or open a bug ticket instead of patching.
### Learning Dist::Zilla
Dist::Zilla is a very powerful authoring tool, but requires a number of
author-specific plugins. If you would like to use it for contributing,
install it from CPAN, then run one of the following commands, depending on
your CPAN client:
$ cpan `dzil authordeps`
$ dzil authordeps | cpanm
$ cpan `dzil authordeps`
$ dzil authordeps | cpanm
Once installed, here are some dzil commands you might try:
$ dzil build
$ dzil test
$ dzil xtest
$ dzil build
$ dzil test
$ dzil xtest
You can learn more about Dist::Zilla at http://dzil.org/
Release notes for HTTP-Tiny
0.036 2013-09-25 12:10:06 America/New_York
[FIXED]
- Compile test could hang on Windows
[PREREQS]
- Dropped configure_requires for ExtUtils::MakeMaker to 6.17
[META]
- Updated support files
0.035 2013-09-10 12:29:28 America/New_York
[CHANGED]
- Encoded from data from 'post_form' preserves term order if data is
provided as an array reference. (They are still sorted for consistency
if provided as a hash reference.)
0.034 2013-06-26 19:02:25 America/New_York
[ADDED]
......
......@@ -6,6 +6,7 @@ META.json
META.yml
Makefile.PL
README
cpanfile
dist.ini
eg/get.pl
eg/mirror.pl
......@@ -58,6 +59,7 @@ t/cases/form-01.txt
t/cases/form-02.txt
t/cases/form-03.txt
t/cases/form-04.txt
t/cases/form-05.txt
t/cases/get-01.txt
t/cases/get-02.txt
t/cases/get-03.txt
......
......@@ -5,7 +5,7 @@
"David Golden <dagolden@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.131560",
"generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660",
"license" : [
"perl_5"
],
......@@ -28,7 +28,7 @@
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.30"
"ExtUtils::MakeMaker" : "6.17"
}
},
"develop" : {
......@@ -66,14 +66,15 @@
"Exporter" : "0",
"ExtUtils::MakeMaker" : "0",
"File::Basename" : "0",
"File::Find" : "0",
"File::Spec" : "0",
"File::Spec::Functions" : "0",
"File::Temp" : "0",
"IO::Dir" : "0",
"IO::File" : "0",
"IO::Handle" : "0",
"IO::Socket::INET" : "0",
"IPC::Cmd" : "0",
"IPC::Open3" : "0",
"List::Util" : "0",
"Test::More" : "0.96",
"open" : "0"
......@@ -83,7 +84,7 @@
"provides" : {
"HTTP::Tiny" : {
"file" : "lib/HTTP/Tiny.pm",
"version" : "0.034"
"version" : "0.036"
}
},
"release_status" : "stable",
......@@ -91,14 +92,15 @@
"bugtracker" : {
"web" : "https://github.com/chansen/p5-http-tiny/issues"
},
"homepage" : "https://metacpan.org/release/HTTP-Tiny",
"homepage" : "https://github.com/chansen/p5-http-tiny",
"repository" : {
"type" : "git",
"url" : "git://github.com/chansen/p5-http-tiny.git",
"url" : "https://github.com/chansen/p5-http-tiny.git",
"web" : "https://github.com/chansen/p5-http-tiny"
}
},
"version" : "0.034",
"version" : "0.036",
"x_authority" : "cpan:DAGOLDEN",
"x_contributors" : [
"Alan Gardner <gardner@pythian.com>",
"Alessandro Ghedini <al3xbio@gmail.com>",
......
......@@ -8,21 +8,22 @@ build_requires:
Exporter: 0
ExtUtils::MakeMaker: 0
File::Basename: 0
File::Find: 0
File::Spec: 0
File::Spec::Functions: 0
File::Temp: 0
IO::Dir: 0
IO::File: 0
IO::Handle: 0
IO::Socket::INET: 0
IPC::Cmd: 0
IPC::Open3: 0
List::Util: 0
Test::More: 0.96
open: 0
configure_requires:
ExtUtils::MakeMaker: 6.30
ExtUtils::MakeMaker: 6.17
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.131560'
generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132660'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -39,7 +40,7 @@ no_index:
provides:
HTTP::Tiny:
file: lib/HTTP/Tiny.pm
version: 0.034
version: 0.036
recommends:
HTTP::CookieJar: 0.001
IO::Socket::SSL: 1.42
......@@ -56,9 +57,10 @@ requires:
warnings: 0
resources:
bugtracker: https://github.com/chansen/p5-http-tiny/issues
homepage: https://metacpan.org/release/HTTP-Tiny
repository: git://github.com/chansen/p5-http-tiny.git
version: 0.034
homepage: https://github.com/chansen/p5-http-tiny
repository: https://github.com/chansen/p5-http-tiny.git
version: 0.036
x_authority: cpan:DAGOLDEN
x_contributors:
- 'Alan Gardner <gardner@pythian.com>'
- 'Alessandro Ghedini <al3xbio@gmail.com>'
......
......@@ -4,7 +4,7 @@ use warnings;
use 5.006;
use ExtUtils::MakeMaker 6.30;
use ExtUtils::MakeMaker 6.17;
......@@ -13,7 +13,7 @@ my %WriteMakefileArgs = (
"AUTHOR" => "Christian Hansen <chansen\@cpan.org>, David Golden <dagolden\@cpan.org>",
"BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30"
"ExtUtils::MakeMaker" => "6.17"
},
"DISTNAME" => "HTTP-Tiny",
"EXE_FILES" => [],
......@@ -33,19 +33,20 @@ my %WriteMakefileArgs = (
"Exporter" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Basename" => 0,
"File::Find" => 0,
"File::Spec" => 0,
"File::Spec::Functions" => 0,
"File::Temp" => 0,
"IO::Dir" => 0,
"IO::File" => 0,
"IO::Handle" => 0,
"IO::Socket::INET" => 0,
"IPC::Cmd" => 0,
"IPC::Open3" => 0,
"List::Util" => 0,
"Test::More" => "0.96",
"open" => 0
},
"VERSION" => "0.034",
"VERSION" => "0.036",
"test" => {
"TESTS" => "t/*.t"
}
......
......@@ -2,7 +2,7 @@ NAME
HTTP::Tiny - A small, simple, correct HTTP/1.1 client
VERSION
version 0.034
version 0.036
SYNOPSIS
use HTTP::Tiny;
......@@ -113,8 +113,11 @@ METHODS
This method executes a "POST" request and sends the key/value pairs from
a form data hash or array reference to the given URL with a
"content-type" of "application/x-www-form-urlencoded". See documentation
for the "www_form_urlencode" method for details on the encoding.
"content-type" of "application/x-www-form-urlencoded". If data is
provided as an array reference, the order is preserved; if provided as a
hash reference, the terms are sorted on key and value for consistency.
See documentation for the "www_form_urlencode" method for details on the
encoding.
The URL must have unsafe characters escaped and international domain
names encoded. See "request()" for valid options and a description of
......@@ -245,8 +248,11 @@ METHODS
reference into a "x-www-form-urlencoded" string. The keys and values
from the data reference will be UTF-8 encoded and escaped per RFC 3986.
If a value is an array reference, the key will be repeated with each of
the values of the array reference. The key/value pairs in the resulting
string will be sorted by key and value.
the values of the array reference. If data is provided as a hash
reference, the key/value pairs in the resulting string will be sorted by
key and value for consistent ordering.
To preserve the order (r
SSL SUPPORT
Direct "https" connections are supported only if IO::Socket::SSL 1.56 or
......@@ -391,7 +397,7 @@ SUPPORT
<https://github.com/chansen/p5-http-tiny>
git clone git://github.com/chansen/p5-http-tiny.git
git clone https://github.com/chansen/p5-http-tiny.git
AUTHORS
* Christian Hansen <chansen@cpan.org>
......
requires "Carp" => "0";
requires "IO::Socket" => "0";
requires "MIME::Base64" => "0";
requires "Time::Local" => "0";
requires "bytes" => "0";
requires "perl" => "5.006";
requires "strict" => "0";
requires "warnings" => "0";
recommends "HTTP::CookieJar" => "0.001";
recommends "IO::Socket::SSL" => "1.42";
recommends "Mozilla::CA" => "20120823";
recommends "Net::SSLeay" => "1.49";
suggests "IO::Socket::SSL" => "1.56";
on 'test' => sub {
requires "Data::Dumper" => "0";
requires "Exporter" => "0";
requires "ExtUtils::MakeMaker" => "0";
requires "File::Basename" => "0";
requires "File::Spec" => "0";
requires "File::Spec::Functions" => "0";
requires "File::Temp" => "0";
requires "IO::Dir" => "0";
requires "IO::File" => "0";
requires "IO::Handle" => "0";
requires "IO::Socket::INET" => "0";
requires "IPC::Cmd" => "0";
requires "IPC::Open3" => "0";
requires "List::Util" => "0";
requires "Test::More" => "0.96";
requires "open" => "0";
};
on 'configure' => sub {
requires "ExtUtils::MakeMaker" => "6.17";
};
on 'develop' => sub {
requires "Pod::Coverage::TrustPod" => "0";
requires "Test::CPAN::Meta" => "0";
requires "Test::Pod" => "1.41";
requires "Test::Pod::Coverage" => "1.08";
};
......@@ -5,35 +5,8 @@ license = Perl_5
copyright_holder = Christian Hansen
[@DAGOLDEN]
AutoMetaResources.bugtracker.rt = 0
AutoMetaResources.bugtracker.github = 0
stopwords = Alessandro
stopwords = CA's
stopwords = CAcert
stopwords = Claes
stopwords = EINTR
stopwords = Eklund
stopwords = Ghedini
stopwords = IPv
stopwords = Jakobsson
stopwords = Lukas
stopwords = Nehren
stopwords = SSL
stopwords = Serguei
stopwords = Trouchelle
stopwords = Weyl
stopwords = Zborowski
stopwords = chunked
stopwords = iteratively
stopwords = proxied
stopwords = redirections
stopwords = timestamp
[MetaResources]
bugtracker.web = https://github.com/chansen/p5-http-tiny/issues
repository.url = git://github.com/chansen/p5-http-tiny.git
repository.web = https://github.com/chansen/p5-http-tiny
repository.type = git
:version = 0.053
stopwords = CA
[RemovePrereqs]
remove = Errno
......
......@@ -3,7 +3,7 @@ package HTTP::Tiny;
use strict;
use warnings;
# ABSTRACT: A small, simple, correct HTTP/1.1 client
our $VERSION = '0.034'; # VERSION
our $VERSION = '0.036'; # VERSION
use Carp ();
......@@ -189,7 +189,7 @@ sub www_form_urlencode {
}
}
return join("&", sort @terms);
return join("&", (ref $data eq 'ARRAY') ? (@terms) : (sort @terms) );
}
#--------------------------------------------------------------------------#
......@@ -1008,7 +1008,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client
=head1 VERSION
version 0.034
version 0.036
=head1 SYNOPSIS
......@@ -1142,7 +1142,9 @@ The C<success> field of the response will be true if the status code is 2XX.
This method executes a C<POST> request and sends the key/value pairs from a
form data hash or array reference to the given URL with a C<content-type> of
C<application/x-www-form-urlencoded>. See documentation for the
C<application/x-www-form-urlencoded>. If data is provided as an array
reference, the order is preserved; if provided as a hash reference, the terms
are sorted on key and value for consistency. See documentation for the
C<www_form_urlencode> method for details on the encoding.
The URL must have unsafe characters escaped and international domain names
......@@ -1299,8 +1301,10 @@ This method converts the key/value pairs from a data hash or array reference
into a C<x-www-form-urlencoded> string. The keys and values from the data
reference will be UTF-8 encoded and escaped per RFC 3986. If a value is an
array reference, the key will be repeated with each of the values of the array
reference. The key/value pairs in the resulting string will be sorted by key
and value.
reference. If data is provided as a hash reference, the key/value pairs in the
resulting string will be sorted by key and value for consistent ordering.
To preserve the order (r
=for Pod::Coverage agent
cookie_jar
......@@ -1516,7 +1520,7 @@ public review and contribution under the terms of the license.
L<https://github.com/chansen/p5-http-tiny>
git clone git://github.com/chansen/p5-http-tiny.git
git clone https://github.com/chansen/p5-http-tiny.git
=head1 AUTHORS
......
......@@ -16,6 +16,7 @@ allow = refs
[-References::ProhibitDoubleSigils]
[-RegularExpressions::RequireExtendedFormatting]
[-InputOutput::ProhibitTwoArgOpen]
[-Modules::ProhibitEvilModules]
# Turn this on
[Lax::ProhibitStringyEval::ExceptForRequire]
......
#!perl
use strict;
use warnings;
use Test::More;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.033
use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
use File::Find;
use File::Temp qw{ tempdir };
my @modules;
find(
sub {
return if $File::Find::name !~ /\.pm\z/;
my $found = $File::Find::name;
$found =~ s{^lib/}{};
$found =~ s{[/\\]}{::}g;
$found =~ s/\.pm$//;
# nothing to skip
push @modules, $found;
},
'lib',
my @module_files = (
'HTTP/Tiny.pm'
);
sub _find_scripts {
my $dir = shift @_;
my @found_scripts = ();
find(
sub {
return unless -f;
my $found = $File::Find::name;
# nothing to skip
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;
},
$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");
# fake home for cpan-testers
use File::Temp;
local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 );
use File::Spec;
use IPC::Open3;
use IO::Handle;
my @warnings;
for my $lib (@module_files)
{
# fake home for cpan-testers
local $ENV{HOME} = tempdir( CLEANUP => 1 );
like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
for sort @modules;
SKIP: {
eval "use Test::Script 1.05; 1;";
skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
foreach my $file ( @scripts ) {
my $script = $file;
$script =~ s!.*/!!;
script_compiles( $file, "$script script compiles" );
}
# see L<perlfaq8/How can I capture STDERR from an external command?>
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($? >> 8, 0, "$lib loaded ok");
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
......@@ -15,17 +15,18 @@ my @modules = qw(
Exporter
ExtUtils::MakeMaker
File::Basename
File::Find
File::Spec
File::Spec::Functions
File::Temp
HTTP::CookieJar
IO::Dir
IO::File
IO::Handle
IO::Socket
IO::Socket::INET
IO::Socket::SSL
IPC::Cmd
IPC::Open3
List::Util
MIME::Base64
Mozilla::CA
......
......@@ -33,7 +33,7 @@ for my $file ( dir_list("t/cases", qr/^form/ ) ) {
my @params = split "\\|", $case->{content}[0];
my $formdata;
if ( $case->{datatype} eq 'HASH' ) {
if ( $case->{datatype}[0] eq 'HASH' ) {
while ( @params ) {
my ($key, $value) = splice( @params, 0, 2 );
if ( ref $formdata->{$key} ) {
......@@ -66,6 +66,7 @@ for my $file ( dir_list("t/cases", qr/^form/ ) ) {
my $label = basename($file);
is( sort_headers($got_req), sort_headers($expect_req), "$label request" );
my ($rc) = $give_res =~ m{\S+\s+(\d+)}g;
......
......@@ -3,7 +3,7 @@ url
content
bar|baz|ack|foo
datatype
ARRAY
HASH
----------
POST /new HTTP/1.1
Host: example.com
......
url
http://example.com/new
content
bar|baz|ack|foo
datatype
ARRAY
----------
POST /new HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
bar=baz&ack=foo
----------
HTTP/1.1 201 Created
Date: Thu, 03 Feb 1994 00:00:00 GMT
Location: http://example.com/new/01.txt
Content-Length: 0
......@@ -2,34 +2,15 @@ use strict;
use warnings;
use Test::More;
# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006000
eval "use Test::Spelling 0.12; use Pod::Wordlist::hanekomu; 1" or die $@;
# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001
use Test::Spelling 0.12;
use Pod::Wordlist;
add_stopwords(<DATA>);
all_pod_files_spelling_ok( qw( bin lib ) );
__DATA__
Alessandro
CA's
CAcert
Claes
EINTR
Eklund
Ghedini
IPv
Jakobsson
Lukas
Nehren
SSL
Serguei
Trouchelle
Weyl
Zborowski
chunked
iteratively
proxied
redirections
timestamp
CA
Christian
Hansen
chansen
......@@ -39,13 +20,19 @@ dagolden
Alan
Gardner
gardner
Alessandro
Ghedini
al3xbio
Brad
Gilbert
bgills
Chris
Nehren
apeiron
Weyl
cweyl
Claes
Jakobsson
claes
Craig
Berry
......@@ -53,10 +40,13 @@ cberry
Mitchell
davem
Edward
Zborowski
ed
Jess
Robinson
castaway
Lukas
Eklund
leklund
Martin
Bright
......@@ -64,6 +54,8 @@ mlbright
Mike
Doherty
doherty
Serguei
Trouchelle
stro
Syohei
YOSHIDA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment