Permalink
Browse files

prepapre for 0.8

  • Loading branch information...
1 parent 61fc826 commit cc93c4514d7a12315554ba49500c62a18eea83b6 @mithun committed Oct 14, 2012
Showing with 125 additions and 106 deletions.
  1. +10 −0 Changes
  2. +3 −3 META.json
  3. +3 −3 META.yml
  4. +7 −7 Makefile.PL
  5. +14 −17 README
  6. +9 −0 changes.mkdn
  7. +41 −33 lib/URI/Encode.pm
  8. +38 −43 readme.mkdn
View
@@ -2,6 +2,16 @@ Version History for URI-Encode
Mithun Ayachit
+0.08
+====
+
+- [RT #80177] doh! double_encode wasn't working at all. Fixed now.
+ Thanks DWRIGHT ...
+- [RT #80178] Do not reset default options when they (not all) are
+ passed to the constructor. Thanks DWRIGHT ...
+- Updated some POD. Do not promote the old interface for setting
+ options
+
0.07
====
View
@@ -4,7 +4,7 @@
"Mithun Ayachit <mithun@cpan.org>"
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4001, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921",
"keywords" : [
"uri",
"escape",
@@ -41,7 +41,7 @@
"provides" : {
"URI::Encode" : {
"file" : "lib/URI/Encode.pm",
- "version" : "0.07"
+ "version" : "0.08"
}
},
"release_status" : "stable",
@@ -57,5 +57,5 @@
"url" : "git://github.com/mithun/perl-uri-encode.git"
}
},
- "version" : "0.07"
+ "version" : "0.08"
}
View
@@ -8,7 +8,7 @@ build_requires:
configure_requires:
Module::Build: 0.38
dynamic_config: 1
-generated_by: 'Module::Build version 0.4001, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921'
keywords:
- uri
- escape
@@ -22,7 +22,7 @@ name: URI-Encode
provides:
URI::Encode:
file: lib/URI/Encode.pm
- version: 0.07
+ version: 0.08
requires:
Encode: 2.12
perl: v5.8.1
@@ -31,4 +31,4 @@ resources:
homepage: https://github.com/mithun/perl-uri-encode
license: http://dev.perl.org/licenses/
repository: git://github.com/mithun/perl-uri-encode.git
-version: 0.07
+version: 0.08
View
@@ -1,17 +1,17 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.4001
+# Note: this file was auto-generated by Module::Build::Compat version 0.4003
require 5.008001;
use ExtUtils::MakeMaker;
WriteMakefile
(
+ 'PL_FILES' => {},
+ 'INSTALLDIRS' => 'site',
'NAME' => 'URI::Encode',
+ 'EXE_FILES' => [],
'VERSION_FROM' => 'lib/URI/Encode.pm',
'PREREQ_PM' => {
- 'Encode' => '2.12',
'Test::More' => 0,
- 'version' => 0
- },
- 'INSTALLDIRS' => 'site',
- 'EXE_FILES' => [],
- 'PL_FILES' => {}
+ 'version' => 0,
+ 'Encode' => '2.12'
+ }
)
;
View
@@ -8,7 +8,7 @@ SYNOPSIS
# OOP Interface
use URI::Encode;
- my $uri = URI::Encode->new({encode_reserved =>0});
+ my $uri = URI::Encode->new( { encode_reserved => 0 } );
my $encoded = $uri->encode($data);
my $decoded = $uri->decode($encoded);
@@ -58,22 +58,22 @@ If true, "Reserved Characters" are also encoded. Defaults to false.
my $encoder = URI::Encode->new({double_encode => 1});
-If true, characters that are already percent-encoded will not be encoded
-again. Defaults to true.
+If false, characters that are already percent-encoded will not be
+encoded again. Defaults to true.
my $encoder = URI::Encode->new({double_encode => 0});
print $encoder->encode('http://perl.com/foo%20bar'); # prints http://perl.com/foo%20bar
-encode($url, $including\_reserved)
-----------------------------------
+encode($url, \\%options)
+------------------------
-This method encodes the URL provided. The method does not encode any
-"Reserved Characters" unless $including_reserved is true or set in the
-constructor. The $url provided is first converted into UTF-8 before
-percent encoding.
+This method encodes the URL provided. The $url provided is first
+converted into UTF-8 before percent encoding. Options set in the
+constructor, or defaults, can be overrided by passing them as the
+(optional) second argument. Options passed must be a hashref.
- $uri->encode("http://perl.com/foo bar"); # http://perl.com/foo%20bar
- $uri->encode("http://perl.com/foo bar", 1); # http%3A%2F%2Fperl.com%2Ffoo%20bar
+ $uri->encode("http://perl.com/foo bar");
+ $uri->encode( "http://perl.com/foo bar", { encode_reserved => 1 } );
decode($url)
------------
@@ -83,19 +83,16 @@ using this module (or any other method), chances are that the URL was
converted to UTF-8 before 'percent' encoding. Be sure to check the
format and convert back if required.
- $uri->decode("http%3A%2F%2Fperl.com%2Ffoo%20bar"); # "http://perl.com/foo bar"
+ $uri->decode("http%3A%2F%2Fperl.com%2Ffoo%20bar");
EXPORTED FUNCTIONS
==================
The following functions are exported upon request. This provides a
non-OOP interface
-uri\_encode($url, \\%options)
------------------------------
-
-uri\_decode($url)
------------------
+- uri_encode($url, \%options)
+- uri_decode($url)
CHARACTER CLASSES
=================
View
@@ -2,6 +2,15 @@
% Mithun Ayachit
%
+# 0.08
+
+- [RT \#80177] doh! double\_encode wasn't working at all. Fixed now.
+ Thanks DWRIGHT ...
+- [RT \#80178] Do not reset default options when they (not all) are
+ passed to the constructor. Thanks DWRIGHT ...
+- Updated some POD. Do not promote the old interface for setting
+ options
+
# 0.07
- Fix issue where '%' was not being encoded unless `encode_reserved`
View
@@ -5,14 +5,15 @@ package URI::Encode;
#######################
use strict;
use warnings FATAL => 'all';
+
use 5.008001;
use Encode qw();
use Carp qw(croak carp);
#######################
# VERSION
#######################
-our $VERSION = '0.07';
+our $VERSION = '0.08';
#######################
# EXPORT
@@ -196,7 +197,7 @@ URI::Encode - Simple percent Encoding/Decoding
# OOP Interface
use URI::Encode;
- my $uri = URI::Encode->new({encode_reserved =>0});
+ my $uri = URI::Encode->new( { encode_reserved => 0 } );
my $encoded = $uri->encode($data);
my $decoded = $uri->decode($encoded);
@@ -205,20 +206,22 @@ URI::Encode - Simple percent Encoding/Decoding
my $encoded = uri_encode($data);
my $decoded = uri_decode($encoded);
+
=head1 DESCRIPTION
This modules provides simple URI (Percent) encoding/decoding
-The main purpose of this module (at least for me) was to provide an easy method
-to encode strings (mainly URLs) into a format which can be pasted into a plain
-text emails, and that those links are 'click-able' by the person reading that
-email. This can be accomplished by NOT encoding the reserved characters.
+The main purpose of this module (at least for me) was to provide an
+easy method to encode strings (mainly URLs) into a format which can be
+pasted into a plain text emails, and that those links are 'click-able'
+by the person reading that email. This can be accomplished by NOT
+encoding the reserved characters.
-This module can also be useful when using L<HTTP::Tiny> to ensure the URLs are
-properly escaped.
+This module can also be useful when using L<HTTP::Tiny> to ensure the
+URLs are properly escaped.
-If you are looking for speed and want to encode reserved characters, use
-L<URI::Escape::XS>
+If you are looking for speed and want to encode reserved characters,
+use L<URI::Escape::XS>
See L<this
script|https://github.com/mithun/perl-uri-encode/raw/master/.author/benchmark.pl>
@@ -246,41 +249,45 @@ If true, L</"Reserved Characters"> are also encoded. Defaults to false.
my $encoder = URI::Encode->new({double_encode => 1});
-If true, characters that are already percent-encoded will not be encoded again.
-Defaults to true.
+If false, characters that are already percent-encoded will not be
+encoded again. Defaults to true.
my $encoder = URI::Encode->new({double_encode => 0});
print $encoder->encode('http://perl.com/foo%20bar'); # prints http://perl.com/foo%20bar
=back
-=head2 C<encode($url, $including_reserved)>
+=head2 C<encode($url, \%options)>
-This method encodes the URL provided. The method does not encode any
-L</"Reserved Characters"> unless C<$including_reserved> is true or set in the
-constructor. The $url provided is first converted into UTF-8 before percent
-encoding.
+This method encodes the URL provided. The C<$url> provided is first
+converted into UTF-8 before percent encoding. Options set in the
+constructor, or defaults, can be overrided by passing them as the
+(optional) second argument. Options passed must be a hashref.
- $uri->encode("http://perl.com/foo bar"); # http://perl.com/foo%20bar
- $uri->encode("http://perl.com/foo bar", 1); # http%3A%2F%2Fperl.com%2Ffoo%20bar
+ $uri->encode("http://perl.com/foo bar");
+ $uri->encode( "http://perl.com/foo bar", { encode_reserved => 1 } );
=head2 C<decode($url)>
-This method decodes a 'percent' encoded URL. If you had encoded the URL using
-this module (or any other method), chances are that the URL was converted to
-UTF-8 before 'percent' encoding. Be sure to check the format and convert back
-if required.
+This method decodes a 'percent' encoded URL. If you had encoded the URL
+using this module (or any other method), chances are that the URL was
+converted to UTF-8 before 'percent' encoding. Be sure to check the
+format and convert back if required.
- $uri->decode("http%3A%2F%2Fperl.com%2Ffoo%20bar"); # "http://perl.com/foo bar"
+ $uri->decode("http%3A%2F%2Fperl.com%2Ffoo%20bar");
=head1 EXPORTED FUNCTIONS
-The following functions are exported upon request. This provides a non-OOP
-interface
+The following functions are exported upon request. This provides a
+non-OOP interface
-=head2 C<uri_encode($url, \%options)>
+=over
-=head2 C<uri_decode($url)>
+=item C<uri_encode($url, \%options)>
+
+=item C<uri_decode($url)>
+
+=back
=head1 CHARACTER CLASSES
@@ -294,7 +301,8 @@ requested.
=head2 Unreserved Characters
-The following characters are considered as Unreserved. They will not be encoded
+The following characters are considered as Unreserved. They will not be
+encoded
a-z
A-Z
@@ -325,8 +333,8 @@ L<Tie::UrlEncoder>
=head1 BUGS AND LIMITATIONS
-Please report any bugs or feature requests to C<bug-uri-encode@rt.cpan.org>, or
-through the web interface at
+Please report any bugs or feature requests to
+C<bug-uri-encode@rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org/Public/Dist/Display.html?Name=URI-Encode>
=head1 AUTHOR
@@ -337,7 +345,7 @@ Mithun Ayachit C<mithun@cpan.org>
Copyright (c) 2012, Mithun Ayachit. All rights reserved.
-This module is free software; you can redistribute it and/or modify it under
-the same terms as Perl itself. See L<perlartistic>.
+This module is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself. See L<perlartistic>.
=cut
Oops, something went wrong. Retry.

0 comments on commit cc93c45

Please sign in to comment.