dunno if t0m is the main current maintainer anymore :)
[gitmo/MooseX-ConfigFromFile.git] / README
diff --git a/README b/README
index 6f251de..03072a2 100644 (file)
--- a/README
+++ b/README
@@ -9,10 +9,10 @@ SYNOPSIS
 
       package MooseX::SomeSpecificConfigRole;
       use Moose::Role;
-      
-  with 'MooseX::ConfigFromFile';
-      
-  use Some::ConfigFile::Loader ();
+  
+      with 'MooseX::ConfigFromFile';
+  
+      use Some::ConfigFile::Loader ();
 
       sub get_config_from_file {
         my ($class, $file) = @_;
@@ -30,6 +30,9 @@ SYNOPSIS
       use Moose;
       with 'MooseX::SomeSpecificConfigRole';
 
+      # optionally, default the configfile:
+      sub configfile { '/tmp/foo.yaml' }
+
       # ... insert your stuff here ...
 
       ########
@@ -48,6 +51,9 @@ DESCRIPTION
     "new_with_config", and requires that concrete roles derived from it
     implement the class method "get_config_from_file".
 
+    Attributes specified directly as arguments to "new_with_config"
+    supercede those in the configfile.
+
     MooseX::Getopt knows about this abstract role, and will use it if
     available to load attributes from the file specified by the commandline
     flag "--configfile" during its normal "new_with_options".
@@ -55,7 +61,15 @@ DESCRIPTION
 Attributes
   configfile
     This is a Path::Class::File object which can be coerced from a regular
-    pathname string. This is the file your attributes are loaded from.
+    pathname string. This is the file your attributes are loaded from. You
+    can add a default configfile in the class using the role and it will be
+    honored at the appropriate time:
+
+      has +configfile ( default => '/etc/myapp.yaml' );
+
+    Note that you can alternately just provide a "configfile" method which
+    returns the config file when called - this will be used in preference to
+    the default of the attribute.
 
 Class Methods
   new_with_config
@@ -70,16 +84,22 @@ Class Methods
   get_config_from_file
     This class method is not implemented in this role, but it is required of
     all subroles. Its two arguments are the classname and the configfile,
-    and it is expected to return a hashref of arguments to pass to "new()".
+    and it is expected to return a hashref of arguments to pass to "new()"
+    which are sourced from the configfile.
 
-  meta
-    The Moose meta stuff, included here because otherwise pod tests fail
-    sometimes
+COPYRIGHT
+    Copyright (c) 2007 - 2009 the MooseX::ConfigFromFile "AUTHOR" and
+    "CONTRIBUTORS" as listed below.
 
-BUGS
 AUTHOR
     Brandon L. Black, <blblack@gmail.com>
 
+CONTRIBUTORS
+    Tomas Doran "<bobtfish@bobtfish.net>" (current maintainer).
+    Karen Etheridge
+    Chris Prather
+    Zbigniew Lukasiak
+
 LICENSE
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.