From: Karen Etheridge Date: Sun, 3 Feb 2013 03:14:14 +0000 (-0800) Subject: conversion to Path::Tiny X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Runnable.git;a=commitdiff_plain;h=29f9c8ccc4b6c72ed0b1a8455e2c2e72da90d95b conversion to Path::Tiny --- diff --git a/Changes b/Changes index 0d15c57..b9d002b 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ + + - converted uses of Path::Class to Path::Tiny (Karen Etheridge) + 0.03 Sat Jun 26 23:19:41 CDT 2010 - modified verification of RunnableClass values to use Params::Util::_CLASS (Karen Etheridge) diff --git a/Makefile.PL b/Makefile.PL index 389ea8a..b46c676 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,7 +6,8 @@ all_from 'lib/MooseX/Runnable.pm'; requires 'Moose'; requires 'MooseX::Getopt'; # not really requires 'MooseX::Types' => '0.10'; -requires 'MooseX::Types::Path::Class'; +requires 'Path::Tiny'; +requires 'MooseX::Types::Path::Tiny'; requires 'namespace::autoclean'; requires 'List::MoreUtils'; requires 'Params::Util'; diff --git a/lib/MooseX/Runnable/Invocation/Plugin/Restart/Auto.pm b/lib/MooseX/Runnable/Invocation/Plugin/Restart/Auto.pm index 210b833..93f0ec4 100644 --- a/lib/MooseX/Runnable/Invocation/Plugin/Restart/Auto.pm +++ b/lib/MooseX/Runnable/Invocation/Plugin/Restart/Auto.pm @@ -2,7 +2,8 @@ package MooseX::Runnable::Invocation::Plugin::Restart::Auto; use Moose::Role; use MooseX::Types; use MooseX::Types::Moose qw(ArrayRef RegexpRef Any Str); -use MooseX::Types::Path::Class qw(Dir); +use MooseX::Types::Path::Tiny qw(Path); +use Path::Tiny; # exports path() use File::ChangeNotify; use namespace::autoclean; @@ -26,10 +27,10 @@ has 'watch_regexp' => ( has 'watch_directories' => ( is => 'ro', - isa => ArrayRef[Dir], + isa => ArrayRef[Path], required => 1, coerce => 1, - default => sub { [Path::Class::dir('.')] }, + default => sub { [path('.')] }, ); has 'watcher' => ( @@ -66,7 +67,7 @@ sub _build_initargs_from_cmdline { } } my %result; - $result{watch_directories} = [map { Path::Class::dir($_) } @dirs] if @dirs; + $result{watch_directories} = [map { path($_) } @dirs] if @dirs; $result{watch_regexp} = $regexp if $regexp; return \%result; } diff --git a/lib/MooseX/Runnable/Util/ArgParser.pm b/lib/MooseX/Runnable/Util/ArgParser.pm index 965d39f..9263fa2 100644 --- a/lib/MooseX/Runnable/Util/ArgParser.pm +++ b/lib/MooseX/Runnable/Util/ArgParser.pm @@ -1,7 +1,8 @@ package MooseX::Runnable::Util::ArgParser; use Moose; use MooseX::Types::Moose qw(HashRef ArrayRef Str Bool); -use MooseX::Types::Path::Class qw(Dir); +use MooseX::Types::Path::Tiny qw(Path); +use Path::Tiny; # exports path() use List::MoreUtils qw(first_index); use FindBin; @@ -30,7 +31,7 @@ has 'modules' => ( has 'include_paths' => ( is => 'ro', - isa => ArrayRef[Dir], + isa => ArrayRef[Path], lazy_build => 1, auto_deref => 1, ); @@ -119,7 +120,7 @@ sub _build_modules { sub _build_include_paths { my $self = shift; my @args = $self->argv; - return [ map { Path::Class::dir($_) } _look_for_dash_something 'I', @args ]; + return [ map { path($_) } _look_for_dash_something 'I', @args ]; } sub _build_is_help {