]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit.pm
Remove trailing whitespace
[perl/modules/rgit.git] / lib / App / Rgit.pm
index d2fe602f4c6b41814da2f57792d7d80e7431f7f9..1c8873d714b3a8a360a6091c38f123b658467a39 100644 (file)
@@ -3,11 +3,6 @@ package App::Rgit;
 use strict;
 use warnings;
 
-use Cwd qw/abs_path/;
-use File::Spec::Functions qw/file_name_is_absolute/;
-
-use Object::Tiny qw/config command/;
-
 use App::Rgit::Command;
 use App::Rgit::Config;
 use App::Rgit::Utils qw/validate/;
@@ -18,11 +13,11 @@ App::Rgit - Backend that supports the rgit utility.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.06
 
 =cut
 
-our $VERSION = '0.01';
+our $VERSION = '0.06';
 
 =head1 DESCRIPTION
 
@@ -40,22 +35,22 @@ Creates a new L<App::Rgit> object that's bound to execute the command C<$cmd> on
 
 sub new {
  my ($class, %args) = &validate;
- my $root = $args{root};
- return unless defined $root and -d $root;
- $root = abs_path $root unless file_name_is_absolute $root;
- return unless defined $args{git} and -x $args{git};
  my $config = App::Rgit::Config->new(
-  root => $root,
-  git  => $args{git},
+  root  => $args{root},
+  git   => $args{git},
+  debug => $args{debug},
  );
- $class->SUPER::new(
-  config  => $config,
-  command => App::Rgit::Command->new(
-   cmd   => $args{cmd},
-   args  => $args{args},
-   repos => $config->repos,
-  )
+ return unless defined $config;
+ my $command = App::Rgit::Command->new(
+  cmd    => $args{cmd},
+  args   => $args{args},
+  policy => $args{policy},
  );
+ return unless defined $command;
+ bless {
+  config  => $config,
+  command => $command,
+ }, $class;
 }
 
 =head2 C<run>
@@ -73,7 +68,13 @@ sub run {
 
 =head2 C<command>
 
-Accessors.
+Read-only accessors.
+
+=cut
+
+BEGIN {
+ eval "sub $_ { \$_[0]->{$_} }" for qw/config command/;
+}
 
 =head1 SEE ALSO
 
@@ -82,7 +83,7 @@ L<rgit>.
 =head1 AUTHOR
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
-   
+
 You can contact me by mail or on C<irc.perl.org> (vincent).
 
 =head1 BUGS
@@ -97,7 +98,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2008 Vincent Pit, all rights reserved.
+Copyright 2008-2009 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.