[libcode-tidyall-perl] 29/374: add docs
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:25:43 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcode-tidyall-perl.
commit a631218cbacf87b84abddb941fc21cd79eb76611
Author: Jonathan Swartz <swartz at pobox.com>
Date: Fri Jun 15 23:24:40 2012 -0500
add docs
---
bin/tidyall | 6 ++++--
lib/Code/TidyAll.pm | 49 +++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/bin/tidyall b/bin/tidyall
index 0d689b2..0c6078d 100755
--- a/bin/tidyall
+++ b/bin/tidyall
@@ -92,9 +92,11 @@ tidyall - Your all-in-one code tidier and validator
-h, --help Print help message
--backup-ttl When backup files can be purged. Defaults to "1h"
--class Code::TidyAll subclass to use. Defaults to "Code::TidyAll"
+ --conf-file Specify conf file explicitly; usually inferred from specified files or cwd
--data-dir Contains data like backups and cache. Defaults to root_dir/.tidyall.d
--no-backup Don't backup files
--no-cache Don't cache last processed times; process all files every time
+ --root-dir Specify root dir explicitly; usually inferred from specified files or cwd
=head1 DESCRIPTION
@@ -132,7 +134,7 @@ hierarchy of files. svn or git working directories are typical examples of
projects.
The top of the project is called the I<root directory>. In the root directory
-you'll need a C<tidyall.ini> config file. It defines how various tidiers and
+you'll need a C<tidyall.ini> config file; it defines how various tidiers and
validators will be applied to the files in your project.
C<tidyall> will find your root directory and config file automatically
@@ -151,7 +153,7 @@ C<tidyall.ini>.
=item tidyall -a --root-dir dir
-C<tidyall> will expect to find C<tidyall.ini> in the specified directory.
+C<tidyall> will expect to find C<tidyall.ini> in the specified root directory.
=back
diff --git a/lib/Code/TidyAll.pm b/lib/Code/TidyAll.pm
index 78c6023..d79169e 100644
--- a/lib/Code/TidyAll.pm
+++ b/lib/Code/TidyAll.pm
@@ -22,7 +22,6 @@ sub valid_params {
no_backups
no_cache
plugins
- recursive
root_dir
verbose
);
@@ -353,20 +352,31 @@ Code::TidyAll - Engine for tidyall, your all-in-one code tidier and validator
}
}
);
- $ct->process_paths($path1, $path2);
+
+ # then...
+
+ $ct->process_files($file1, $file2);
+
+ # or
+
+ $ct->process_all();
=head1 DESCRIPTION
-This is the engine used by L<tidyall|tidyall>, which you can use from your own
-program instead of calling C<tidyall>.
+This is the engine used by L<tidyall|tidyall>. You can call this API from your
+own program instead of executing C<tidyall>.
=head1 CONSTRUCTOR OPTIONS
-These options are the same as the equivalents in C<tidyall>, replacing dashes
-with underscore (e.g. the C<backup-ttl> option becomes C<backup_ttl> here).
+You must either pass C<conf_file>, or both C<plugins> and C<root_dir>.
=over
+=item plugins
+
+Specify a hash of plugins, each of which is itself a hash of options. This is
+equivalent to what would be parsed out of the sections in C<tidyall.ini>.
+
=item backup_ttl
=item conf_file
@@ -379,10 +389,33 @@ with underscore (e.g. the C<backup-ttl> option becomes C<backup_ttl> here).
=item plugins
-=item recursive
-
=item root_dir
=item verbose
+These options are the same as the equivalent C<tidyall> command-line options,
+replacing dashes with underscore (e.g. the C<backup-ttl> option becomes
+C<backup_ttl> here).
+
+=back
+
+=head1 METHODS
+
+=over
+
+=item process_all
+
+Process all files; this implements the C<tidyall -a> option.
+
+=item process_files (file, ...)
+
+Process the specified files.
+
+=item find_conf_file (start_dir)
+
+Start in the I<start_dir> and work upwards, looking for a C<tidyall.ini>.
+Return the pathname if found or throw an error if not found.
+
=back
+
+=cut
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list