HTTP-Link-0.001/0000755000076500000240000000000012554372775013572 5ustar davidzurborgstaffHTTP-Link-0.001/Changes0000644000076500000240000000012712554372775015065 0ustar davidzurborgstaffRevision history for HTTP-Link 0.001 2015-07-24 - Initial release 0.000 0000-00-00 HTTP-Link-0.001/dist.ini0000644000076500000240000000026612554372775015242 0ustar davidzurborgstaffname = HTTP-Link author = David Zurborg license = ISC copyright_holder = David Zurborg copyright_year = 2015 ; authordep Software::License::ISC [@ZURBORG] HTTP-Link-0.001/lib/0000755000076500000240000000000012554372775014340 5ustar davidzurborgstaffHTTP-Link-0.001/lib/HTTP/0000755000076500000240000000000012554372775015117 5ustar davidzurborgstaffHTTP-Link-0.001/lib/HTTP/Link.pm0000644000076500000240000002065112554372775016356 0ustar davidzurborgstaffuse strictures 2; package HTTP::Link; # ABSTRACT: RFC5988 Web Linking use Exporter qw(import); use MIME::EcoEncode::Param qw(mime_eco_param mime_deco_param); our $VERSION = '0.001'; # VERSION our @EXPORT_OK = qw( httplink_new httplink_rel httplink_multi httplink_parse httplink_parse_hash ); our %EXPORT_TAGS = ( all => \@EXPORT_OK, ); sub _encode { my $str = shift; my $estr = '=' . $str; my $xstr = mime_eco_param( $estr, 'UTF-8?B', '', 2**31 ); if ( $estr eq $xstr ) { return '="' . $str . '"'; } else { return '*' . $xstr; } } sub httplink_new { unshift @_ => __PACKAGE__; goto &new; } sub httplink_rel { unshift @_ => __PACKAGE__; goto &rel; } sub httplink_multi { unshift @_ => __PACKAGE__; goto &multi; } sub httplink_parse { unshift @_ => __PACKAGE__; goto &parse; } sub httplink_parse_hash { unshift @_ => __PACKAGE__; goto &parse_hash; } sub new { my $self = shift; my ( $iri, %options ) = @_; my $str = "<$iri>"; if ( my $relation = delete $options{relation} ) { if ( ref $relation eq 'ARRAY' ) { $str .= '; rel="' . join( ' ', @$relation ) . '"'; } else { if ( my $extension = delete $options{extension} ) { $relation .= " $extension"; } $str .= '; rel="' . $relation . '"'; } } if ( my $anchor = delete $options{anchor} ) { $str .= '; anchor="' . $anchor . '"'; } if ( my $hreflang = delete $options{hreflang} ) { $str .= '; hreflang="' . $hreflang . '"'; } if ( my $media = delete $options{media} ) { $str .= '; media="' . $media . '"'; } if ( my $title = delete $options{title} ) { $str .= '; title' . _encode($title); } if ( my $type = delete $options{type} ) { $str .= '; type="' . $type . '"'; } return $str; } sub rel { my ( $self, $iri, $relation, $extension, %options ) = @_; return $self->new( $iri, %options, relation => $relation, extension => $extension ); } sub multi { my $self = shift; if ( @_ == 1 and ref $_[0] eq 'HASH' ) { return $self->multi( %{ $_[0] } ); } my %map = @_; my @str; foreach my $iri ( keys %map ) { my $part = delete $map{$iri}; push @str => $self->new( $iri, %$part ); } return join ', ', sort @str; } my $ptoken = qr{[ \!\#\$\%\&\'\(\)\*\+\-\.\/\d\:\<\=\>\?\@\[\]\^\_\`\{\|\}\~ a-z ]+}xsi; my $lparam = qr{ = (?: " [^"]*? " | $ptoken ) }sx; my $split = qr{ \s* = \s* (?"?) \s* (? .* ) \s* \k \s* }sx; my $re = qr{ < (? [^>]+ ) > (?: \s* ;[\s*;]* \s* (?: rel (? $lparam ) | anchor (? $lparam ) | rev (? $lparam ) | hreflang (? $lparam ) | media (? $lparam ) | title (? $lparam ) | title\* (?<xtitle> $lparam ) | type (?<type> $lparam ) ) \s* )* [\s*;]* }sx; sub parse { my ( $self, $str ) = @_; $str .= ','; pos($str) = 0; my @results; while ( $str =~ m{ \G \s* $re \s* ,+ }sxg ) { my %r = %+; my $r = {}; foreach my $k (qw(iri relation rev anchor hreflang media title type)) { next unless defined $r{$k}; my $v = $r{$k}; $v =~ s{^$split$}{$+{val}}sxe; $r->{$k} = $v; } if ( defined $r->{relation} and $r->{relation} =~ m{^ ( [a-z] [a-z\d\.\-]* ) \s+ (.+) $}six ) { $r->{relation} = $1; $r->{extension} = $2; } if ( exists $r{xtitle} ) { my ( $decoded, $param, $charset, $lang, $value ) = mime_deco_param( $r{xtitle} ); $r->{title} = $value; } push @results => $r; } return @results; } sub parse_hash { my ( $self, $str ) = @_; my @list = $self->parse($str); my %hash; foreach my $elem (@list) { my $iri = delete $elem->{iri}; $hash{$iri} = $elem; } return %hash; } 1; __END__ =pod =head1 NAME HTTP::Link - RFC5988 Web Linking =head1 VERSION version 0.001 =head1 METHODS =head2 new Return a new Web Link as string my $link = HTTP::Link->new('/TheBook/Chapter/2', relation => 'next', title => 'next chapter', ); # Result: # </TheBook/Chapter/2>; rel="next"; title="next chapter" B<Arguments>: =over 4 =item * C<$iri> An internationalized resource identifier. This is a target uri reference. =item * C<%options> Additional parameters (see below) =back B<Parameters> for C<%options>: =over 4 =item * C<relation> Possible relation types are: I<alternate>, I<appendix>, I<bookmark>, I<chapter>, I<contents>, I<copyright>, I<current>, I<describedby>, I<edit>, I<edit-media>, I<enclosure>, I<first>, I<glossary>, I<help>, I<hub>, I<index>, I<last>, I<latest-version>, I<license>, I<next>, I<next-archive>, I<payment>, I<prev>, I<predecessor-version>, I<previous>, I<prev-archive>, I<related>, I<replies>, I<section>, I<self>, I<service>, I<start>, I<stylesheet>, I<subsection>, I<successor-version>, I<up>, I<version-history>, I<via>, I<working-copy>, I<working-copy-of> and others (see IANA registry) =item * C<extension> An extension for a relation type. =item * C<anchor> An anchor for the context IRI. =item * C<hreflang> A hint indicating what the language of the destination's content is =item * C<media> Intended destination medium, like in a CSS media query. =item * C<title> A human-readable label. This will be encoded with L<MIME::EcoEncode>. =item * C<type> A hint indication the most possible MIME type of the destination's content. =back =head2 rel Shortcut method for L</new> with a different signature: HTTP::Link->rel('/TheBook/Chapter/2', start => '/TheBook/Chapter/0' ); # same as HTTP::Link->new('/TheBook/Chapter/2', relation => 'start', extension => '/TheBook/Chapter/0', ); B<Arguments>: =over 4 =item * C<$iri> See L</new> =item * C<$relation> Will appended to C<%options> by C< relation => $relation >> =item * C<$extension> Will appended to C<%options> by C< extension => $extension >> =item * C<%options> See L</new> =back =head2 multi When more than one link should be provides, this method is useful. It accepts a hash or a HashRef with a mapping of IRIs to options. HTTP::Link->multi( '/TheBook/Chapter/2' => { relation => 'previous' }, '/TheBook/Chapter/4' => { relation => 'next' }, ); # Result: # </TheBook/Chapter/2>; rel="previous", </TheBook/Chapter/4>; rel="next" =head2 parse Parses a Link-header field a returns all founded links as a list of HashRefs. my @links = HTTP::Link->parse(<<EOT); </TheBook/Chapter/2>; rel="previous", </TheBook/Chapter/4>; rel="next" EOT # Result: @links = ({ iri => '/TheBook/Chapter/2', relation => 'previous' },{ iri => '/TheBook/Chapter/4', relation => 'next' }); =head2 parse_hash Parses a Link-header field a returns all founded links as a HashRef with IRIs as key: my %links = HTTP::Link->parse_hash(<<EOT); </TheBook/Chapter/2>; rel="previous", </TheBook/Chapter/4>; rel="next" EOT # Result: %links = ( '/TheBook/Chapter/2' => { relation => 'previous' }, '/TheBook/Chapter/4' => { relation => 'next' } ); =head1 FUNCTIONS =head2 httplink_new Wrapper for C<< HTTP::Link-> >>L</new> =head2 httplink_rel Wrapper for C<< HTTP::Link-> >>L</rel> =head2 httplink_multi Wrapper for C<< HTTP::Link-> >>L</multi> =head2 httplink_parse Wrapper for C<< HTTP::Link-> >>L</parse> =head2 httplink_parse_hash Wrapper for C<< HTTP::Link-> >>L</parse_hash> =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libhttp-link-perl/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR David Zurborg <zurborg@cpan.org> =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2015 by David Zurborg. This is free software, licensed under: The ISC License =cut ���������������������������������������������������������������������������������������HTTP-Link-0.001/LICENSE�����������������������������������������������������������������������������0000644�0000765�0000024�00000001454�12554372775�014603� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This software is Copyright (c) 2015 by David Zurborg. This is free software, licensed under: The ISC License Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. The software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/Makefile.PL�������������������������������������������������������������������������0000644�0000765�0000024�00000002243�12554372775�015545� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.025. use strict; use warnings; use 5.010; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "RFC5988 Web Linking", "AUTHOR" => "David Zurborg <zurborg\@cpan.org>", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "HTTP-Link", "EXE_FILES" => [], "LICENSE" => "open_source", "MIN_PERL_VERSION" => "5.010", "NAME" => "HTTP::Link", "PREREQ_PM" => { "Exporter" => 0, "MIME::EcoEncode::Param" => 0, "strictures" => 2 }, "TEST_REQUIRES" => { "Test::More" => 0 }, "VERSION" => "0.001", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "MIME::EcoEncode::Param" => 0, "Test::More" => 0, "strictures" => 2 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/MANIFEST����������������������������������������������������������������������������0000644�0000765�0000024�00000000533�12554372775�014724� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.025. Changes LICENSE MANIFEST META.yml Makefile.PL README SIGNATURE dist.ini lib/HTTP/Link.pm perlcritic.rc t/author-critic.t t/multi.t t/new.t t/parse.t t/parse_hash.t t/rel.t t/release-cpan-changes.t t/release-kwalitee.t t/release-pod-coverage.t t/release-pod-syntax.t ���������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/META.yml����������������������������������������������������������������������������0000644�0000765�0000024�00000001330�12554372775�015040� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- abstract: 'RFC5988 Web Linking' author: - 'David Zurborg <zurborg@cpan.org>' build_requires: Test::More: '0' perl: '5.010' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.010' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.025, CPAN::Meta::Converter version 2.143240' license: open_source meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: HTTP-Link requires: Exporter: '0' MIME::EcoEncode::Param: '0' perl: '5.010' strictures: '2' resources: bugtracker: https://github.com/zurborg/libhttp-link-perl/issues homepage: https://github.com/zurborg/libhttp-link-perl repository: https://github.com/zurborg/libhttp-link-perl.git version: '0.001' ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/perlcritic.rc�����������������������������������������������������������������������0000644�0000765�0000024�00000000224�12554372775�016256� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[TestingAndDebugging::RequireUseStrict] equivalent_modules = strictures [TestingAndDebugging::RequireUseWarnings] equivalent_modules = strictures ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/README������������������������������������������������������������������������������0000644�0000765�0000024�00000000425�12554372775�014453� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ This archive contains the distribution HTTP-Link, version 0.001: RFC5988 Web Linking This software is Copyright (c) 2015 by David Zurborg. This is free software, licensed under: The ISC License This README file was generated by Dist::Zilla::Plugin::Readme v5.025. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/SIGNATURE���������������������������������������������������������������������������0000644�0000765�0000024�00000004733�12554372775�015065� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 61c6ebbbbc3442575db1274a1149a3f704607f02 Changes SHA1 21696e04788daf443832163be15c96a621ae5381 LICENSE SHA1 d92b8d369e1fc2dd2a78ffec9852746bdd010850 MANIFEST SHA1 df118265792973f9b70e8902c4ec925100234375 META.yml SHA1 7e8eec173cf52d7ef952c13bfd49a66ab963ee0b Makefile.PL SHA1 79f1c54e884684b0875824ae465c6b3c34e29ab8 README SHA1 4b76c75a5fc5f32ca5653b3ab210d682cbbfdc6e dist.ini SHA1 21134514883b87e985cc52643f56fb0d696603f0 lib/HTTP/Link.pm SHA1 1aa22866215fb8bb0211939910115fb62be8c96b perlcritic.rc SHA1 f214de96cfe8b70da71201ab8859bb32cbdafe1d t/author-critic.t SHA1 95b52526a2d197437cd768f8a96e2fa3b984ae59 t/multi.t SHA1 b80adf926606ae0c00897eb4c41a4969226e1fa9 t/new.t SHA1 2e87b7228137333987f0017c3fa1d9ad9ae3f73e t/parse.t SHA1 29adf79e9b058bdb5ec1447d58cf3cef34c2ab26 t/parse_hash.t SHA1 b26a8e876060653aa43944da7256d6ae8885e4f0 t/rel.t SHA1 1bf69b71b924777ef46b198af9435e8381149fc7 t/release-cpan-changes.t SHA1 bdd52baa1a968cc0e1a577a7b073f046d563a317 t/release-kwalitee.t SHA1 ca37d7b91c2299a98877a6f36d3fab51e8dd906f t/release-pod-coverage.t SHA1 e7fc4d8f3f29ee522cb53914648393524fc7a6d4 t/release-pod-syntax.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJVsfX9AAoJEHwWRyBU62lqyGUQAL5o/D9E5JxPW7pv9PCOg/5o XrUTFgdHh3+mykK8Wld5UFch+mExzWidpjY+3vBwXt3y93RUKZd6WgR+BQWyKiL7 wZ4H7b25VubrzXl4CfOoQe3IRs2Q9gXGStY7ZMsR2AbldbyySvJAabaDycN661TF Oefk5IOzqsc1qMXoVBS49GnSjVb1NsgKZaglsoKDMplBk4epgpUrGwQgnOZSZwrF mOlLtL6YogOeuyPnn9A6s6nY4UcoHngBFFfC0KBlLeYH8Iu8s5Yu/+mjCemFkvJ7 1Tpyzn41okg3V2LElPFNd0ar8O5uGQOvxhkfgSx4MbBZnl1bSl69/8nXosXjL9M6 wNvrfaxa1ZRxOSbGLHCtg+KCGNxaEdV+MKGksTvQxi31VdpsQLaS+C9uKJWNbEmZ Vu4mVsP11h5jBhYzEL71Tcd7qN3+GRe/lKUSpcDss/Y1dfIxX3nIvwKaw5iD94u4 o3z/jJbeulANDKdOzaXsKdzYGH1CEU4y4qP/BsrHGI/9uxQwPixpQfpDAgO6l7Gn jWNAcVt0GHP1CBgLnMAUlkiaHT5597QjPfg42yinhtrNAmaVFnHCulrFgPD/papb 1/cKVOKG2+nRzBJZKA4MYWpFEjaeADuYH6U+bz/JH6rJDp7UXAdrLy13Fn7G4iKE iP+oZXSMkkSEESNsmOFH =ojmP -----END PGP SIGNATURE----- �������������������������������������HTTP-Link-0.001/t/����������������������������������������������������������������������������������0000755�0000765�0000024�00000000000�12554372775�014035� 5����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/author-critic.t�������������������������������������������������������������������0000644�0000765�0000024�00000000721�12554372775�016777� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl BEGIN { unless ( $ENV{AUTHOR_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for testing by the author' ); } } use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); �����������������������������������������������HTTP-Link-0.001/t/multi.t���������������������������������������������������������������������������0000644�0000765�0000024�00000003145�12554372775�015357� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use Test::More; BEGIN { use_ok('HTTP::Link'); } is( HTTP::Link->multi( A => { relation => 'B', extension => 'C', anchor => 'D', hreflang => 'F', media => 'G', title => 'H', }, ) => '<A>; rel="B C"; anchor="D"; hreflang="F"; media="G"; title="H"' ); is( HTTP::Link->multi( A => { relation => 'B', extension => 'C', anchor => 'D', hreflang => 'F', media => 'G', title => 'H', }, I => { relation => 'J', extension => 'K', anchor => 'L', hreflang => 'N', media => 'O', title => 'P', }, ) => '<A>; rel="B C"; anchor="D"; hreflang="F"; media="G"; title="H", <I>; rel="J K"; anchor="L"; hreflang="N"; media="O"; title="P"' ); is( HTTP::Link->multi( { A => { relation => 'B', extension => 'C', anchor => 'D', hreflang => 'F', media => 'G', title => 'H', }, I => { relation => 'J', extension => 'K', anchor => 'L', hreflang => 'N', media => 'O', title => 'P', }, } ) => '<A>; rel="B C"; anchor="D"; hreflang="F"; media="G"; title="H", <I>; rel="J K"; anchor="L"; hreflang="N"; media="O"; title="P"' ); done_testing; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/new.t�����������������������������������������������������������������������������0000644�0000765�0000024�00000002764�12554372775�015024� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use Test::More; BEGIN { use_ok('HTTP::Link'); } is( HTTP::Link->new('') => '<>' ); is( HTTP::Link->new('A') => '<A>' ); is( HTTP::Link->new('<>') => '<<>>' ); is( HTTP::Link->new( 'A', relation => 'B' ) => '<A>; rel="B"' ); is( HTTP::Link->new( 'A', relation => [qw[ B C D E F ]] ) => '<A>; rel="B C D E F"' ); is( HTTP::Link->new( 'A', relation => 'B', extension => 'C' ) => '<A>; rel="B C"' ); is( HTTP::Link->new( 'A', anchor => 'B' ) => '<A>; anchor="B"' ); is( HTTP::Link->new( 'A', hreflang => 'B' ) => '<A>; hreflang="B"' ); is( HTTP::Link->new( 'A', media => 'B' ) => '<A>; media="B"' ); is( HTTP::Link->new( 'A', title => 'B' ) => '<A>; title="B"' ); is( HTTP::Link->new( 'A', title => '"' ) => '<A>; title*="=?UTF-8?B?Ig==?="' ); is( HTTP::Link->new( 'A', title => '?' ) => '<A>; title*="=?UTF-8?B?Pw==?="' ); is( HTTP::Link->new( 'A', title => '=' ) => '<A>; title*="=?UTF-8?B?PQ==?="' ); is( HTTP::Link->new( 'A', relation => 'B', extension => 'C', anchor => 'C', hreflang => 'E', media => 'F', title => 'G' ) => '<A>; rel="B C"; anchor="C"; hreflang="E"; media="F"; title="G"' ); is( HTTP::Link->new( 'A', relation => 'B', extension => 'C', anchor => 'C', hreflang => 'E', media => 'F', title => "\xe6\xa1\x9c" ) => '<A>; rel="B C"; anchor="C"; hreflang="E"; media="F"; title*="=?UTF-8?B?5qGc?="' ); done_testing; ������������HTTP-Link-0.001/t/parse.t���������������������������������������������������������������������������0000644�0000765�0000024�00000002455�12554372775�015342� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use Test::More; BEGIN { use_ok('HTTP::Link'); } sub test { my @a = HTTP::Link->parse(shift); my @b = @_; @_ = ( \@a, \@b ); goto &Test::More::is_deeply; } test( '<A>; rel="B X"; anchor="C"; rev="D"; hreflang="E"; media="F"; title="G"', { iri => 'A', relation => 'B', extension => 'X', anchor => 'C', rev => 'D', hreflang => 'E', media => 'F', title => 'G', } ); test( '<A>; rel="B X"; anchor="C"; rev="D"; hreflang="E"; media="F"; title="G", <I>; rel="J K"; anchor="L"; rev="M"; hreflang="N"; media="O"; title="P"', { iri => 'A', relation => 'B', extension => 'X', anchor => 'C', rev => 'D', hreflang => 'E', media => 'F', title => 'G', }, { iri => 'I', relation => 'J', extension => 'K', anchor => 'L', rev => 'M', hreflang => 'N', media => 'O', title => 'P', } ); test( '<A>; title*="=?UTF-8?B?Ig==?="', { iri => 'A', title => '"' } ); test( '<A>; title*="=?UTF-8?B?Pw==?="', { iri => 'A', title => '?' } ); test( '<A>; title*="=?UTF-8?B?PQ==?="', { iri => 'A', title => '=' } ); done_testing; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/parse_hash.t����������������������������������������������������������������������0000644�0000765�0000024�00000002404�12554372775�016337� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use Test::More; BEGIN { use_ok('HTTP::Link'); } sub test { my %a = HTTP::Link->parse_hash(shift); #use Data::Dumper; #diag Dumper(\%a); my %b = @_; @_ = ( \%a, \%b ); goto &Test::More::is_deeply; } test( '<A>; rel="B X"; anchor="C"; rev="D"; hreflang="E"; media="F"; title="G"', A => { relation => 'B', extension => 'X', anchor => 'C', rev => 'D', hreflang => 'E', media => 'F', title => 'G', } ); test( <<'EOT', <A>; rel="B X"; anchor="C"; rev="D"; hreflang="E"; media="F"; title="G"; , <I> ;rel="J K" ;anchor="L" ;rev="M" ;hreflang="N" ;media="O" ;title="P" EOT A => { relation => 'B', extension => 'X', anchor => 'C', rev => 'D', hreflang => 'E', media => 'F', title => 'G', }, I => { relation => 'J', extension => 'K', anchor => 'L', rev => 'M', hreflang => 'N', media => 'O', title => 'P', } ); 00 && test(<<'EOT'); </TheBook/chapter2>; rel="previous"; title*=UTF-8'de'letztes%20Kapitel, </TheBook/chapter4>; rel="next"; title*=UTF-8'de'n%c3%a4chstes%20Kapitel EOT done_testing; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/rel.t�����������������������������������������������������������������������������0000644�0000765�0000024�00000000572�12554372775�015010� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use Test::More; BEGIN { use_ok('HTTP::Link'); } is( HTTP::Link->rel( 'A', 'B' => 'C' ) => '<A>; rel="B C"' ); is( HTTP::Link->rel( 'A', 'B' => 'C', anchor => 'C', hreflang => 'E', media => 'F', title => 'G' ) => '<A>; rel="B C"; anchor="C"; hreflang="E"; media="F"; title="G"' ); done_testing; ��������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/release-cpan-changes.t������������������������������������������������������������0000644�0000765�0000024�00000000554�12554372775�020173� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl BEGIN { unless ( $ENV{RELEASE_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for release candidate testing' ); } } use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); ����������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/release-kwalitee.t����������������������������������������������������������������0000644�0000765�0000024�00000001010�12554372775�017435� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl BEGIN { unless ( $ENV{RELEASE_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for release candidate testing' ); } } # This test is generated by Dist::Zilla::Plugin::Test::Kwalitee::Extra use strict; use warnings; use Test::More; # needed to provide plan. eval { require Test::Kwalitee::Extra }; plan skip_all => "Test::Kwalitee::Extra required for testing kwalitee: $@" if $@; eval "use Test::Kwalitee::Extra qw( !prereq_matches_use )" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/release-pod-coverage.t������������������������������������������������������������0000644�0000765�0000024�00000000630�12554372775�020212� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl BEGIN { unless ( $ENV{RELEASE_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for release candidate testing' ); } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok( { coverage_class => 'Pod::Coverage::TrustPod' } ); ��������������������������������������������������������������������������������������������������������HTTP-Link-0.001/t/release-pod-syntax.t��������������������������������������������������������������0000644�0000765�0000024�00000000512�12554372775�017744� 0����������������������������������������������������������������������������������������������������ustar �davidzurborg��������������������staff������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl BEGIN { unless ( $ENV{RELEASE_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for release candidate testing' ); } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������