X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FConfigFromFile.pm;h=15d677305ca79741183e57d6c572c5b74826ed13;hb=2f049fc1ad9cb0ee9c2d4cd21ec3a138da3bf020;hp=5bdc8c39f2f3e89556e5fa8669d5c4059e31226f;hpb=742b859c0f89bf4dc325980079eb770771c1c709;p=gitmo%2FMooseX-ConfigFromFile.git diff --git a/lib/MooseX/ConfigFromFile.pm b/lib/MooseX/ConfigFromFile.pm index 5bdc8c3..15d6773 100644 --- a/lib/MooseX/ConfigFromFile.pm +++ b/lib/MooseX/ConfigFromFile.pm @@ -1,18 +1,18 @@ package MooseX::ConfigFromFile; use Moose::Role; -use MooseX::Types::Path::Class qw( File ); +use MooseX::Types::Path::Tiny 'Path'; use Try::Tiny qw/ try /; use Carp qw(croak); use namespace::autoclean; -our $VERSION = '0.04'; +our $VERSION = '0.05'; requires 'get_config_from_file'; has configfile => ( is => 'ro', - isa => File, + isa => Path, coerce => 1, predicate => 'has_configfile', do { try { require MooseX::Getopt; (traits => ['Getopt']) } }, @@ -127,8 +127,9 @@ during its normal C. =head2 configfile -This is a L object which can be coerced from a regular pathname -string. This is the file your attributes are loaded from. You can add a default +This is a L object which can be coerced from a regular pathname +string or any object that supports stringification. +This is the file your attributes are loaded from. You can add a default configfile in the consuming class and it will be honored at the appropriate time (note that a simple sub declaration is not sufficient, as there is already a sub by that name being added by Moose as the attribute reader) @@ -163,7 +164,7 @@ a hashref of arguments to pass to C which are sourced from the configfile =head1 COPYRIGHT -Copyright (c) 2007 - 2009 the MooseX::ConfigFromFile "AUTHOR" and "CONTRIBUTORS" as listed below. +Copyright (c) - the MooseX::ConfigFromFile "AUTHOR" and "CONTRIBUTORS" as listed below. =head1 AUTHOR @@ -173,7 +174,7 @@ Brandon L. Black, Eblblack@gmail.comE =over -=item Tomas Doran C<< >> (current maintainer). +=item Tomas Doran =item Karen Etheridge