make spelling tests pass
[gitmo/MooseX-Runnable.git] / lib / MooseX / Runnable / Util / ArgParser.pm
index 833f983..3847747 100644 (file)
@@ -1,7 +1,10 @@
 package MooseX::Runnable::Util::ArgParser;
+# ABSTRACT: parse @ARGV for mx-run
+
 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 +33,7 @@ has 'modules' => (
 
 has 'include_paths' => (
     is         => 'ro',
-    isa        => ArrayRef[Dir],
+    isa        => ArrayRef[Path],
     lazy_build => 1,
     auto_deref => 1,
 );
@@ -119,7 +122,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 {
@@ -232,7 +235,12 @@ sub guess_cmdline {
     my @without_plugins = @{$opts{without_plugins} || []};
 
     # invoke mx-run
-    my @cmdline = ($^X, @perl_flags, $FindBin::Bin.'/'.$FindBin::Script);
+    my @cmdline = (
+        $^X,
+        (map { "-I$_" } @INC),
+        @perl_flags,
+        $FindBin::Bin.'/'.$FindBin::Script,
+    );
     push @cmdline, map { "-I$_" } $self->include_paths;
     push @cmdline, map { "-M$_" } $self->modules;
 
@@ -254,9 +262,9 @@ sub guess_cmdline {
 
 __END__
 
-=head1 NAME
+=pod
 
-MooseX::Runnable::Util::ArgParser - parse @ARGV for mx-run
+=for stopwords mx
 
 =head1 SYNOPSIS