[Bps-public-commit] Config-GitLike branch, master, updated. bf7e83fe01d13316129dd3b6c6a807734b595c5a
Alex M Vandiver
alexmv at bestpractical.com
Fri Jul 10 18:20:44 EDT 2009
The branch, master has been updated
via bf7e83fe01d13316129dd3b6c6a807734b595c5a (commit)
from b31fef6931449da0f5a310eda497caa4d2fbe8de (commit)
Summary of changes:
lib/Config/GitLike/Git.pm | 78 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 78 insertions(+), 0 deletions(-)
create mode 100644 lib/Config/GitLike/Git.pm
- Log -----------------------------------------------------------------
commit bf7e83fe01d13316129dd3b6c6a807734b595c5a
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Jul 10 18:20:31 2009 -0400
Add a Config::GitLike::Git for loading Git config files
diff --git a/lib/Config/GitLike/Git.pm b/lib/Config/GitLike/Git.pm
new file mode 100644
index 0000000..a06d4a1
--- /dev/null
+++ b/lib/Config/GitLike/Git.pm
@@ -0,0 +1,78 @@
+package Config::GitLike::Git;
+
+use strict;
+use warnings;
+
+use Any::Moose;
+
+extends 'Config::GitLike';
+
+has 'confname' => (
+ default => 'git',
+);
+
+sub dir_file {
+ my $self = shift;
+ return ".git/config";
+}
+
+sub user_file {
+ my $self = shift;
+ return
+ File::Spec->catfile( $ENV{'HOME'}, ".gitconfig" );
+}
+
+sub global_file {
+ my $self = shift;
+ return "/etc/gitconfig";
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
+
+__END__
+
+=head1 NAME
+
+Config::GitLike::Git - load Git configuration files
+
+=head1 DESCRIPTION
+
+This is a modification of L<Config::GitLike> to look at the same
+locations that Git writes to.
+
+=head1 METHODS
+
+This module overrides these methods from C<Config::GitLike>:
+
+=head2 dir_file
+
+The per-directory configuration file is F<.git/config>
+
+=head2 user_file
+
+The per-user configuration file is F<~/.gitconfig>
+
+=head2 global_file
+
+The per-host configuration file is F</etc/gitconfig>
+
+=head1 SEE ALSO
+
+L<Config::GitLike|Config::GitLike>
+
+=head1 LICENSE
+
+You may modify and/or redistribute this software under the same terms
+as Perl 5.8.8.
+
+=head1 COPYRIGHT
+
+Copyright 2009 Best Practical Solutions, LLC
+
+=head1 AUTHORS
+
+Alex Vandiver <alexmv at bestpractical.com>,
+Christine Spang <spang at bestpractical.com>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list