diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/libpiny/lib/Piny/Email.pm | 2 | ||||
-rw-r--r-- | usr/src/libpiny/lib/Piny/Repo.pm | 8 | ||||
-rw-r--r-- | usr/src/libpiny/lib/Piny/User.pm | 4 | ||||
-rwxr-xr-x | usr/src/pinyadmin/sbin/newrepo | 6 |
4 files changed, 8 insertions, 12 deletions
diff --git a/usr/src/libpiny/lib/Piny/Email.pm b/usr/src/libpiny/lib/Piny/Email.pm index e031c34..7ad17d8 100644 --- a/usr/src/libpiny/lib/Piny/Email.pm +++ b/usr/src/libpiny/lib/Piny/Email.pm @@ -18,8 +18,6 @@ subtype 'EmailAddress' => message { 'That does not appear to be a valid email address.' } ; -Moose::Util::TypeConstraints::export_type_constraints_as_functions; - # Attributes has 'address' => diff --git a/usr/src/libpiny/lib/Piny/Repo.pm b/usr/src/libpiny/lib/Piny/Repo.pm index 48690c4..926f199 100644 --- a/usr/src/libpiny/lib/Piny/Repo.pm +++ b/usr/src/libpiny/lib/Piny/Repo.pm @@ -4,7 +4,7 @@ package Piny::Repo; use Moose; -use Moose::Util::TypeConstraints; +use Moose::Util::TypeConstraints qw( find_type_constraint ); use File::Find qw( find ); use File::Temp qw( ); @@ -31,8 +31,6 @@ subtype 'SimpleText' => message { 'That description is not in the correct format for a piny repo.' } ; -Moose::Util::TypeConstraints::export_type_constraints_as_functions; - # Attributes has 'name' => @@ -250,8 +248,8 @@ sub create { my $user = Piny::Environment->new->user; - Reponame->assert_valid( $name ); - SimpleText->assert_valid( $description ); + find_type_constraint( "Reponame" )->assert_valid( $name ); + find_type_constraint( "SimpleText" )->assert_valid( $description ); my $repo = $class->new( "name" => $name ); diff --git a/usr/src/libpiny/lib/Piny/User.pm b/usr/src/libpiny/lib/Piny/User.pm index fb9a20f..f38c020 100644 --- a/usr/src/libpiny/lib/Piny/User.pm +++ b/usr/src/libpiny/lib/Piny/User.pm @@ -4,7 +4,7 @@ package Piny::User; use Moose; -use Moose::Util::TypeConstraints; +use Moose::Util::TypeConstraints qw( find_type_constraint ); use Piny::Email; use Piny::Group; @@ -17,8 +17,6 @@ subtype 'Username' => message { 'That username is not in the correct format for a piny user.' } ; -Moose::Util::TypeConstraints::export_type_constraints_as_functions; - # Attributes has 'uid' => diff --git a/usr/src/pinyadmin/sbin/newrepo b/usr/src/pinyadmin/sbin/newrepo index 1f83e82..49a4755 100755 --- a/usr/src/pinyadmin/sbin/newrepo +++ b/usr/src/pinyadmin/sbin/newrepo @@ -3,6 +3,8 @@ use strict; use warnings; +use Moose::Util::TypeConstraints qw( find_type_constraint ); + use Piny; my ( $name ) = @ARGV; @@ -12,7 +14,7 @@ if ( not defined $name ) { exit 1; }; -if ( not Piny::Repo::Reponame->check( $name ) ) { +if ( not find_type_constraint( "Reponame" )->check( $name ) ) { print "That is not a valid repo name; must be at least 1 character long, begin with a lowercase alphanumeric character, and contain only alphanumeric characters and dashes.\n"; exit 1; }; @@ -23,7 +25,7 @@ while( 1 ) { print "Provide a one-line description to be used in repo listings, the shorter the better:\n"; chomp( $description = <STDIN> ); - if ( not Piny::Repo::SimpleText->check( $description ) ) { + if ( not find_type_constraint( "SimpleText" )->check( $description ) ) { print "Must be 1-80 characters long; control characters (including tab) not allowed.\n"; next; }; |