Commits

Toby Inkster committed 3bc0bce

switch from Any::Moose to plain Moose (RDF::Trine uses Moose now, so there is no point in not using Moose)

Comments (0)

Files changed (9)

 	$Web::ID::VERSION   = '1.921';
 }
 
-use Any::Moose 'X::Types::Moose' => [':all'];
-use Web::ID::Types ':all';
+use MooseX::Types::Moose -all;
+use Web::ID::Types -all;
 use Web::ID::Certificate;
 use Web::ID::Util qw(:default uniq);
 
-use Any::Moose;
-use namespace::clean -except => 'meta';
+use Moose;
+use namespace::sweep;
 
 has certificate => (
 	is          => read_only,
 	isa         => Certificate,
 	required    => true,
 	coerce      => true,
-	);
+);
 
 has uri => (
 	is          => read_only,
 	isa         => Uri,
 	lazy_build  => true,
 	coerce      => true,
-	);
+);
 
 has profile => (
 	is          => read_only,
 	isa         => Model,
 	lazy_build  => true,
-	);
+);
 
 has valid => (
 	is          => read_only,
 	isa         => Bool,
 	lazy_build  => true,
-	);
+);
 
 has first_valid_san => (
 	is          => read_only,
 	isa         => San | Undef,
 	lazy_build  => true,
-	);
+);
 
 sub _build_valid
 {

lib/Web/ID/Certificate.pm

 
 use Crypt::X509 0.50 ();  # why the hell does this export anything?!
 use DateTime 0;
-use Any::Moose 'X::Types::Moose' => [':all'];
+use MooseX::Types::Moose -all;
 use Digest::SHA qw(sha1_hex);
 use MIME::Base64 0 qw(decode_base64);
-use Web::ID::Types qw(:all);
+use Web::ID::Types -all;
 use Web::ID::SAN;
 use Web::ID::SAN::Email;
 use Web::ID::SAN::URI;
 	isa         => Str,
 	required    => true,
 	coerce      => false,
-	);
+);
 
 has _der => (
 	is          => read_only,
 	isa         => Str,
 	required    => true,
 	lazy_build  => true,
-	);
+);
 
 has _x509 => (
 	is          => read_only,
 	isa         => 'Crypt::X509',
 	lazy_build  => true,
-	);
+);
 
 has public_key => (
 	is          => read_only,
 	isa         => Rsakey,
 	lazy_build  => true,
 	handles     => [qw(modulus exponent)],
-	);
+);
 
 has subject_alt_names => (
 	is          => read_only,
 	isa         => ArrayRef,
 	lazy_build  => true,
-	);
+);
 
 has $_ => (
 	is          => read_only,
 	isa         => Datetime,
 	lazy_build  => true,
 	coerce      => true,
-	)
-	for qw( not_before not_after );
+) for qw( not_before not_after );
 
 has san_factory => (
 	is          => read_only,
 	isa         => CodeRef,
 	lazy_build  => true,
-	);
+);
 
 has fingerprint => (
 	is          => read_only,
 	isa         => Str,
 	lazy_build  => true,
-	);
+);
 
 sub _build_fingerprint
 {

lib/Web/ID/Certificate/Generator.pm

 	$Web::ID::Certificate::Generator::VERSION   = '1.921';
 }
 
-use Any::Moose
-	'X::Types::Moose' => [':all'],
-	'Util' => ['apply_all_roles'];
+use MooseX::Types::Moose -all;
+use Moose::Util qw(apply_all_roles);
 use File::Temp qw();
 use Path::Class qw();
 use RDF::Trine qw(statement blank iri literal);
 use Web::ID::Types ':all';
 use Web::ID::Util;
 
-use Any::Moose 'Role';
-use namespace::clean -except => 'meta';
+use Moose::Role;
+use namespace::sweep;
 
 sub import
 {
 		L    => delete $options{subject_locality},
 		O    => delete $options{subject_org},
 		CN   => delete $options{subject_cn},
-		);
+	);
 	
 	confess "need to provide subject_cn option" unless $subject{CN};
 	
 		"-out"     => $tempdir->file('cert.pem'),
 		"-keyout"  => $tempdir->file('privkey.pem'),
 		"-passout" => "pass:".$passphrase,
-		);
+	);
 	
 	system(
 		$openssl,
 		"-name"    => sprintf('%s <%s>', ($subject{CN}//'Unnamed'), $sans->[0]->value), 
 		"-passin"  => "pass:".$passphrase,
 		"-passout" => "pass:".$passphrase,
-		);
+	);
 	
 	if (ref $dest eq 'SCALAR')
 	{

lib/Web/ID/RSAKey.pm

 	$Web::ID::RSAKey::VERSION   = '1.921';
 }
 
-use Any::Moose 'X::Types::Moose' => [':all'];
-use Web::ID::Types ':all';
+use MooseX::Types::Moose -all;
+use Web::ID::Types -all;
 use Web::ID::Util;
 
-use Any::Moose;
-use namespace::clean -except => 'meta';
+use Moose;
+use namespace::sweep;
 
 for (qw( exponent modulus ))
 {
 		isa         => Bigint,
 		required    => true,
 		coerce      => true,
-		);
+	);
 }
 
 sub rsa_equal

lib/Web/ID/SAN.pm

 	$Web::ID::SAN::VERSION   = '1.921';
 }
 
-use Any::Moose 'X::Types::Moose' => [':all'];
-use Web::ID::Types ':all';
+use MooseX::Types::Moose -all;
+use Web::ID::Types -all;
 use RDF::Query 2.900;
 use URI 0;
 use URI::Escape 0 qw/uri_escape/;
 use Web::ID::RSAKey;
 use Web::ID::Util;
 
-use Any::Moose;
-use namespace::clean -except => 'meta';
+use Moose;
+use namespace::sweep;
 
 has $_ => (
 	is          => read_only,
 	isa         => Str,
 	required    => true,
 	coerce      => false,
-	)
-	for qw(type value);
+) for qw(type value);
 
 has model => (
 	is          => read_only,
 	isa         => Model,
 	lazy_build  => true,
-	);
+);
 
 has key_factory => (
 	is          => read_only,
 	isa         => CodeRef,
 	lazy_build  => true,
-	);
+);
 
 sub _build_model
 {

lib/Web/ID/SAN/Email.pm

 	}
 }
 
-use Any::Moose 'X::Types::Moose' => [':all'];
-use Web::ID::Types ':all';
+use MooseX::Types::Moose -all;
+use Web::ID::Types -all;
 use Web::ID::Util;
 
-use Any::Moose;
-use namespace::clean -except => 'meta';
+use Moose;
+use namespace::sweep;
 extends 'Web::ID::SAN';
 
 has '+type' => (default => 'rfc822Name');
 	isa         => Finger | Undef,
 	lazy        => true,
 	builder     => '_build_finger',
-	);
+);
 
 sub _build_finger
 {
 			$result->{modulus},
 			fallback      => $result->{hexModulus},
 			fallback_type =>'hex',
-			);
+		);
 		my $exponent = make_bigint_from_node(
 			$result->{exponent},
 			fallback      => $result->{decExponent},
 			fallback_type =>'dec',
-			);
+		);
 				
 		my $key = $self->key_factory->(
 			modulus  => $modulus,
 			exponent => $exponent,
-			);
+		);
 		push @keys, $key if $key;
 	}
 	
 {
 	my ($self) = @_;
 	my $email = 'mailto:' . $self->value;
-	return RDF::Query->new( sprintf(<<'SPARQL', (($email)x4)) );
+	return "RDF::Query"->new( sprintf(<<'SPARQL', (($email)x4)) );
 PREFIX cert: <http://www.w3.org/ns/auth/cert#>
 PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
 PREFIX foaf: <http://xmlns.com/foaf/0.1/>

lib/Web/ID/SAN/URI.pm

 	$Web::ID::SAN::URI::VERSION   = '1.921';
 }
 
-use Any::Moose 'X::Types::Moose' => [':all'];
-use Web::ID::Types ':all';
+use MooseX::Types::Moose -all;
+use Web::ID::Types -all;
 use Web::ID::Util;
 
-use Any::Moose;
-use namespace::clean -except => 'meta';
+use Moose;
+use namespace::sweep;
 extends 'Web::ID::SAN';
 
 has '+type' => (default => 'uniformResourceIdentifier');
 			$result->{modulus},
 			fallback      => $result->{hexModulus},
 			fallback_type =>'hex',
-			);
+		);
 		my $exponent = make_bigint_from_node(
 			$result->{exponent},
 			fallback      => $result->{decExponent},
 			fallback_type =>'dec',
-			);
+		);
 		
 		my $key = $self->key_factory->(
 			modulus  => $modulus,
 sub _query
 {
 	my ($self) = @_;
-	return RDF::Query->new( sprintf(<<'SPARQL', (($self->uri_object)x4)) );
+	return "RDF::Query"->new( sprintf(<<'SPARQL', (($self->uri_object)x4)) );
 PREFIX cert: <http://www.w3.org/ns/auth/cert#>
 PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
 SELECT

lib/Web/ID/Types.pm

 use RDF::Trine;
 use URI;
 
-use Any::Moose
-	'X::Types' => [
-		-declare => [qw[ Bigint Certificate Datetime Finger Model Rsakey San Uri ]],
-	],
-	'X::Types::Moose' => [
-		':all',
-	];
+use MooseX::Types
+	-declare => [qw[ Bigint Certificate Datetime Finger Model Rsakey San Uri ]];
+use MooseX::Types::Moose -all;
 
 class_type Bigint, { class => 'Math::BigInt' };
 coerce Bigint,
-	from Str, via { Math::BigInt->new($_) };
+	from Str, via { "Math::BigInt"->new($_) };
 		
 class_type Certificate, { class => 'Web::ID::Certificate' };
 coerce Certificate,
-	from HashRef, via  { Web::ID::Certificate->new(%$_) },
-	from Str,     via  { Web::ID::Certificate->new(pem => $_) };
+	from HashRef, via  { "Web::ID::Certificate"->new(%$_) },
+	from Str,     via  { "Web::ID::Certificate"->new(pem => $_) };
 
 class_type Datetime,	{ class => 'DateTime' };
 coerce Datetime,
-	from Num, via { DateTime->from_epoch(epoch => $_) };
+	from Num, via { "DateTime"->from_epoch(epoch => $_) };
 
 class_type Finger, { class => 'WWW::Finger' };
 coerce Finger,
-	from Str, via { WWW::Finger->new($_) if UNIVERSAL::can('WWW::Finger', 'new') };
+	from Str, via { "WWW::Finger"->new($_) if UNIVERSAL::can('WWW::Finger', 'new') };
 
 class_type Model, { class => 'RDF::Trine::Model' };
 
 class_type Rsakey, { class => 'Web::ID::RSAKey' };
 coerce Rsakey,
-	from HashRef, via  { Web::ID::RSAKey->new(%$_) };
+	from HashRef, via  { "Web::ID::RSAKey"->new(%$_) };
 
 class_type San, { class => 'Web::ID::SAN' };
 
 class_type Uri, { class => 'URI' };
 coerce Uri,
-	from Str, via { URI->new($_) };
+	from Str, via { "URI"->new($_) };
 
 
 __PACKAGE__

meta/makefile.ttl

 	:perl_version_from _:main ;
 	:version_from _:main ;
 	:readme_from _:main ;
-	:recommends
-		"Moose",
-		"MooseX::Types";
 	:requires
-		"Any::Moose",
 		"Crypt::X509",
 		"DateTime",
 		"Digest::SHA",
 		"List::MoreUtils",
-		"MIME::Base64",
-		"Mouse",
-		"MouseX::Types 0.06",
-		"namespace::clean",
+		"Moose",
+		"MooseX::Types",
+		"namespace::sweep",
 		"Path::Class",
 		"Plack",
-		"RDF::Query",
-		"RDF::Trine",
+		"RDF::Query 2.900",
+		"RDF::Trine 1.000",
 		"Sub::Exporter",
 		"URI";
 	:test_requires