Commits

Toby Inkster  committed 8e4c6ad

Stop using MooX::Types::MooseLike; use Types::Standard instead. Stop using smartmatch; use match::smart instead.

  • Participants
  • Parent commits 6695682

Comments (0)

Files changed (7)

File lib/P5U/Command/Aliases.pm

 {
 	my ($self, $opt, $args) = @_;
 	
+	require match::smart;
 	my $filter = scalar(@$args)
 		? $args
-		: sub { not(shift ~~ [qw(aliases commands help)]) };
+		: sub { !match::smart::match(shift, [qw(aliases commands help)]) };
 	
 	foreach my $cmd (sort $self->app->command_plugins)
 	{
 		my ($preferred, @aliases) = $cmd->command_names;
 		printf("%-16s: %s\n", $preferred, "@aliases")
-			if $preferred ~~ $filter;
+			if match::smart::match($preferred, $filter);
 	}
 }
 

File lib/P5U/Lib/DebianRelease.pm

 };
 
 use Moo;
-use MooX::Types::MooseLike::Base qw< HashRef InstanceOf >;
 use IO::Uncompress::Gunzip qw< gunzip $GunzipError >;
 use JSON             2.00  qw< from_json >;
 use LWP::Simple      0     qw< get >;
+use match::smart     0     qw< M >;
 use Object::AUTHORITY qw/AUTHORITY/;
+use Type::Utils      0     qw< class_type >;
+use Types::Standard  0.004 qw< HashRef >;
 
 my $json   = JSON::->new->allow_nonref;
 
 
 has cache_file => (
 	is         => 'ro',
-	isa        => InstanceOf['Path::Class::File'],
 	required   => 1,
+	isa        => class_type { class => 'Path::Class::File' },
 );
 
 sub _build_debian
 	for my $dist (sort keys %dists)
 	{
 		my $pkg = dist2deb($dist);
-		next unless $pkg ~~ $pkgs;
+		next unless $pkg |M| $pkgs;
 		
 		push @data => [
 			$dist,

File lib/P5U/Lib/Reprove.pm

 use autodie;
 
 use Moo;
-use MooX::Types::MooseLike::Base qw< ArrayRef Bool InstanceOf Str >;
 use App::Prove qw//;
 use Class::Load qw/load_class/;
 use Carp qw/confess/;
 use LWP::Simple qw/get/;
 use Module::Manifest qw//;
 use Object::AUTHORITY qw/AUTHORITY/;
+use Types::Standard qw< ArrayRef Bool Str >;
+use Type::Utils qw< class_type >;
 
 has author => (
 	is         => 'lazy',
 
 has testdir => (
 	is         => 'lazy',
-	isa        => InstanceOf['Path::Class::Dir'],
+	isa        => class_type { class => 'Path::Class::Dir' },
 );
 
 has working_dir => (
 	is         => 'lazy',
-	isa        => InstanceOf['Path::Class::Dir'],
+	isa        => class_type { class => 'Path::Class::Dir' },
 );
 
 has verbose => (

File lib/P5U/Lib/Testers.pm

 };
 
 use Moo;
-use MooX::Types::MooseLike::Base qw< ArrayRef Bool Str InstanceOf >;
 use File::Spec       0 qw< >;
 use JSON             0 qw< from_json >;
 use LWP::Simple      0 qw< mirror is_success >;
 use List::Util       0 qw< maxstr >;
+use match::simple    0 qw< M >;
 use Object::AUTHORITY  qw< AUTHORITY >;
 use Path::Class      0 qw< dir file >;
+use Type::Utils      0 qw< class_type >;
+use Types::Standard  0 qw< ArrayRef HashRef Bool Str >;
 use namespace::clean;
 
 has distro => (
 
 has cache_dir => (
 	is         => 'lazy',
-	isa        => InstanceOf['Path::Class::Dir'],
+	isa        => class_type { class => 'Path::Class::Dir' },
 );
 
 has results => (
 	is         => 'lazy',
-	isa        => ArrayRef,
+	isa        => ArrayRef[HashRef],
 );
 
 sub version_data
 	{
 		next unless $_->{version} eq $self->version;
 		my ($pv) = ($_->{perl} =~ /^5\.(\d+)/) or next;
-		next if $pv ~~ [9, 11, 13, 15];
+		next if $pv |M| [9, 11, 13, 15, 17];
 		my $key = $self->os_data
 			? sprintf("Perl 5.%03d, %s", $pv, $_->{ostext})
 			: sprintf("Perl 5.%03d", $pv);

File lib/P5U/Lib/Whois.pm

 };
 
 use Moo; no warnings;
-use MooX::Types::MooseLike::Base qw< ArrayRef HashRef Maybe Num Str >;
+use Types::Standard qw< ArrayRef HashRef Maybe Num Str >;
 use JSON qw(from_json);
 use LWP::Simple qw(get);
 use Object::AUTHORITY;

File lib/P5U/Tutorial/Development.pod

 L<JSON>, L<Path::Class>.
 
 If you need OO, then use L<Moo> (but do it in a workhorse module that's
-loaded on demand) and L<namespace::clean>. If you need the web, then use
-L<LWP::UserAgent> or L<LWP::Simple>. If you need to do stuff with the
-file system, use L<Path::Class> and L<Path::Class::Rule>. These are good
-modules, and they're already listed as P5U dependencies, so there's no
-reason to avoid them.
+loaded on demand), L<Types::Standard> and L<namespace::clean>. If you
+need the web, then use L<LWP::UserAgent> or L<LWP::Simple>. If you need
+to do stuff with the file system, use L<Path::Class> and L<Path::Class::Rule>.
+These are good modules, and they're already listed as P5U dependencies, so
+there's no reason to avoid them.
 
 =head2 TEMPLATE
 

File meta/makefile.ttl

 	:requires           "File::pushd";
 	:requires           "JSON 2.00";
 	:requires           "LWP::Simple";
+	:requires           "match::simple";
 	:requires           "Module::Info";
 	:requires           "Module::Manifest";
-	:requires           "Moo 1.000000";
-	:requires           "MooX::Types::MooseLike::Base";
+	:requires           "Moo 1.002000";
+	:requires           "Types::Standard";
+	:requires           "Type::Utils";
 	:requires           "namespace::clean 0.19";
 	:requires           "Object::AUTHORITY";
 	:requires           "Path::Class";