Skip Menu |

This queue is for tickets about the MooseX-Types-URI CPAN distribution.

Report information
The Basics
Id: 46394
Status: resolved
Priority: 0/
Queue: MooseX-Types-URI

People
Owner: Nobody in particular
Requestors: daniel [...] rimspace.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH 1/2] Use MooseX::Types type declarators in the type coercions.
Date: Wed, 27 May 2009 11:33:31 +1000
To: bug-MooseX-Types-URI [...] rt.cpan.org
From: Daniel Pittman <daniel [...] rimspace.net>
This eliminates a warning from MooseX::Types, and brings this module in line with the documented API. --- lib/MooseX/Types/URI.pm | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) mode change 100644 => 100755 lib/MooseX/Types/URI.pm diff --git a/lib/MooseX/Types/URI.pm b/lib/MooseX/Types/URI.pm old mode 100644 new mode 100755 index 99ac126..3cb502d --- a/lib/MooseX/Types/URI.pm +++ b/lib/MooseX/Types/URI.pm @@ -17,6 +17,7 @@ use URI::FromHash qw(uri); use Moose::Util::TypeConstraints; +use MooseX::Types::Moose qw{Str ScalarRef HashRef}; use MooseX::Types::Path::Class; use namespace::clean; @@ -41,30 +42,29 @@ my $uri = Moose::Meta::TypeConstraint->new( register_type_constraint($uri); coerce( Uri, - from Str => via { URI->new($_) }, - from "Path::Class::File" => via { URI::file->new($_) }, - from "Path::Class::Dir" => via { URI::file->new($_) }, - from ScalarRef => via { my $u = URI->new("data:"); $u->data($$_); $u }, - from HashRef => via { uri(%$_) }, + from Str , via { URI->new($_) }, + from "Path::Class::File" , via { URI::file->new($_) }, + from "Path::Class::Dir" , via { URI::file->new($_) }, + from ScalarRef , via { my $u = URI->new("data:"); $u->data($$_); $u }, + from HashRef , via { uri(%$_) }, ); class_type FileUri, { class => "URI::file", parent => $uri }; coerce( FileUri, - from Str => via { URI::file->new($_) }, - from "Path::Class::File" => via { URI::file->new($_) }, - from "Path::Class::Dir" => via { URI::file->new($_) }, + from Str , via { URI::file->new($_) }, + from "Path::Class::File" , via { URI::file->new($_) }, + from "Path::Class::Dir" , via { URI::file->new($_) }, ); class_type DataUri, { class => "URI::data" }; coerce( DataUri, - from Str => via { my $u = URI->new("data:"); $u->data($_); $u }, - from ScalarRef => via { my $u = URI->new("data:"); $u->data($$_); $u }, + from Str , via { my $u = URI->new("data:"); $u->data($_); $u }, + from ScalarRef , via { my $u = URI->new("data:"); $u->data($$_); $u }, ); -__PACKAGE__ - +1; __END__ =pod -- 1.6.3.1
Subject: Re: [rt.cpan.org #46394] AutoReply: [PATCH 1/2] Use MooseX::Types type declarators in the type coercions.
Date: Wed, 27 May 2009 11:54:53 +1000
To: bug-MooseX-Types-URI [...] rt.cpan.org
From: Daniel Pittman <daniel [...] rimspace.net>
The git integration I was using seems to have lost my cover letter, sorry. When using MooseX::Types::URI I receive the following warnings: WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 49 WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 49 WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 49 WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 57 WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 64 WARNING: String found where Type expected (did you use a => instead of a , ?) at /usr/share/perl5/MooseX/Types/URI.pm line 64 This is with MooseX::Types::URI 0.01, MooseX::Types 0.11 and Perl 5.10.0 on 64-bit Debian/unstable. Regards, Daniel