Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Commit

Permalink
Switch Celogeek::SCK::Cleaner to Moo
Browse files Browse the repository at this point in the history
  • Loading branch information
geistteufel committed Mar 18, 2012
1 parent bd8dfc5 commit a9ba94a
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions lib/Celogeek/SCK/Cleaner.pm
Expand Up @@ -11,17 +11,14 @@ use 5.014;
use Data::Dumper;
use Carp;

use Moose;
with 'MooseX::Getopt';
use MooseX::Params::Validate;
use MooseX::Types::URI qw(Uri);
use Moo;
use MooX::Options;
use URI;
use Regexp::Common qw/number/;

has 'run' => (
documentation => 'remove bad link effectivly',
option 'run' => (
doc => 'remove bad link effectivly',
is => 'rw',
isa => 'Bool',
required => 1,
default => 0,
);

=method is_valid_uri
Expand All @@ -31,14 +28,10 @@ Check if URI is valid
=cut

sub is_valid_uri {
my ( $self, @opts ) = @_;
my ($uri) = validated_list(
\@opts,
uri => {
isa => Uri,
coerce => 1,
}
);
my ( $self, %opts ) = @_;
my $uri = $opts{uri};
ref $uri eq 'URI'
or $uri = URI->new($uri);

my @bad_url_regexes = (
qr{^localhost$}x, qr{^localhost:}x,
Expand Down

0 comments on commit a9ba94a

Please sign in to comment.