From 4e234fc969ae1ec9d66e909a05fa0387bfafb331 Mon Sep 17 00:00:00 2001 From: Ian Beckwith Date: Sat, 1 Mar 2008 00:36:32 +0000 Subject: [PATCH] Imported upstream version 0.11 --- Changes | 5 ++++- MANIFEST | 1 + META.yml | 3 ++- Makefile.PL | 6 ++++++ README | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/URI/Template.pm | 2 +- 6 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 README diff --git a/Changes b/Changes index 6ba0a19..d6a2826 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Perl extension URI::Template -0.10 Wed Jan 16 2007 +0.11 Fri Feb 08 2008 + - require perl 5.6 minimum + +0.10 Wed Jan 16 2008 - fix test suite for JSON 2.x 0.09 Tue Aug 28 2007 diff --git a/MANIFEST b/MANIFEST index 926e9c6..31ee7b1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -14,6 +14,7 @@ lib/URI/Template.pm Makefile.PL MANIFEST This list of files META.yml +README t/01-use.t t/10-basic.t t/11-ordered.t diff --git a/META.yml b/META.yml index 9cd5464..72d5576 100644 --- a/META.yml +++ b/META.yml @@ -17,4 +17,5 @@ no_index: - t requires: URI: 0 -version: 0.10 + perl: 5.6.0 +version: 0.11 diff --git a/Makefile.PL b/Makefile.PL index a7295fc..2c7fd07 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,5 +1,11 @@ use inc::Module::Install 0.68; +if ( -e 'MANIFEST.SKIP' ) { + system( 'pod2text lib/URI/Template.pm > README' ); +} + +perl_version '5.006'; + name 'URI-Template'; all_from 'lib/URI/Template.pm'; diff --git a/README b/README new file mode 100644 index 0000000..fd4982a --- /dev/null +++ b/README @@ -0,0 +1,62 @@ +NAME + URI::Template - Object for handling URI templates + +SYNOPSIS + use URI::Template; + my $template = URI::Template->new( 'http://example.com/{x}' ); + my $uri = $template->process( x => 'y' ); + # uri is a URI object with value 'http://example.com/y' + + my %result = $template->deparse( $uri ); + # %result is ( x => 'y' ) + +DESCRIPTION + This is an initial attempt to provide a wrapper around URI templates as + described at + http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-01.txt + +INSTALLATION + perl Makefile.PL + make + make test + make install + +METHODS + new( $template ) + Creates a new URI::Template instance with the template passed in as the + first parameter. + + as_string( ) + Returns the original template string. Also used when the object is + stringified. + + variables( ) + Returns an array of unique variable names found in the template. NB: + they are returned in random order. + + all_variables( ) + Returns an array of variable names found as they appear in template -- + in order, duplicates included. + + process( %vars|\@values ) + Given a list of key-value pairs or an array ref of values (for + positional substitution), it will URI escape the values and substitute + them in to the template. Returns a URI object. + + process_to_string( %vars|\@values ) + Processes input like the "process" method, but doesn't inflate the + result to a URI object. + + deparse( $uri ) + Does some rudimentary deparsing of a uri based on the current template. + Returns a hash with the extracted values. + +AUTHOR + Brian Cassidy + +COPYRIGHT AND LICENSE + Copyright 2007 by Brian Cassidy + + This library is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. + diff --git a/lib/URI/Template.pm b/lib/URI/Template.pm index 79bffdf..8b67663 100644 --- a/lib/URI/Template.pm +++ b/lib/URI/Template.pm @@ -3,7 +3,7 @@ package URI::Template; use strict; use warnings; -our $VERSION = '0.10'; +our $VERSION = '0.11'; use URI; use URI::Escape (); -- 2.11.0