=head1 METHODS
-=head2 C<< new root => $root, git => $git, cmd => $cmd, args => \@args >>
+=head2 C<new>
+
+ my $ar = App::Rgit->new(
+ root => $root,
+ git => $git,
+ cmd => $cmd,
+ args => \@args,
+ );
Creates a new L<App::Rgit> object that's bound to execute the command C<$cmd> on all the C<git> repositories inside C<$root> with C<@args> as arguments and C<$git> as C<git> executable.
=head1 METHODS
-=head2 C<< new cmd => $cmd, args => \@args >>
+=head2 C<new>
+
+ my $arc = App::Rgit::Command->new(
+ cmd => $cmd,
+ args => \@args,
+ );
Creates a new command object for C<$cmd> that is bound to be called with arguments C<@args>.
}, $class;
}
-=head2 C<< action $cmd [ => $pkg ] >>
+=head2 C<action>
+
+ my $pkg = $arc->action($cmd);
+ $arc->action($cmd => $pkg);
If C<$pkg> is supplied, handles command C<$cmd> with C<$pkg> objects.
Otherwise, returns the current class for C<$cmd>.
$commands{$cmd} = $pkg;
}
-=head2 C<report $conf, $repo, $status>
+=head2 C<report>
+
+ my $code = $arc->report($conf, $repo, $status);
Reports that the execution of the command in C<$repo> exited with C<$status> to the current command's policy.
Returns what policy C<report> method returned, which should be one of the policy codes listed in C<App::Rgit::Utils>.
eval "sub $_ { \$_[0]->{$_} }" for qw/cmd args policy/;
}
-=head2 C<run $conf>
+=head2 C<run>
+
+ my $code = $arc->run($conf);
Runs the command with a L<App::Rgit::Config> configuration object.
Handles back the code to return to the system and the last policy.
=head1 METHODS
-=head2 C<< new root => $root, git => $git >>
+=head2 C<new>
+
+ my $arc = App::Rgit::Config->new(
+ root => $root,
+ git => $git,
+ );
Creates a new configuration object based on the root directory C<$root> and using C<$git> as F<git> executable.
}, $conf;
}
-=head2 C<info $msg>
+=head2 C<info>
+
+ $arr->info($msg);
+
+=head2 C<warn>
+
+ $arr->warn($msg);
+
+=head2 C<err>
-=head2 C<warn $msg>
+ $arr->err($msg);
-=head2 C<err $msg>
+=head2 C<crit>
-=head2 C<crit $msg>
+ $arr->crit($msg);
Notifies a message C<$msg> of the corresponding level.
=head1 METHODS
-=head2 C<new $callback>
+=head2 C<new>
+
+ my $guard = App::Rgit::Guard->new($callback);
Creates a new C<App::Rgit::Guard> object that will call C<$callback> when it is destroyed.
=head1 METHODS
-=head2 C<< new policy => $policy >>
+=head2 C<new>
+
+ my $arp = App::Rgit::Policy->new(policy => $policy);
Creates a new policy object of type C<$policy> by requiring and redispatching the method call to the module named C<$policy> if it contains C<'::'> or to C<App::Rgit::Policy::$policy> otherwise.
The class represented by C<$policy> must inherit this class.
bless { }, $class;
}
-=head2 C<handle $cmd, $config, $repo, $status, $signal>
+=head2 C<handle>
+
+ my $code = $arp->handle($cmd, $config, $repo, $status, $signal);
Make the policy handle the end of execution of the L<App::Rgit::Command> object C<$cmd> with L<App::Rgit::Config> configuration C<$config> in the L<App::Rgit::Repository> repository C<$repo> that exited with status C<$status> and maybe received signal C<$sigal>.
=head1 METHODS
-=head2 C<< new dir => $dir [, fake => 1 ] >>
+=head2 C<new>
+
+ my $arr = App::Rgit::Repository->new(
+ dir => $dir,
+ fake => $bool,
+ );
Creates a new repository starting from C<$dir>.
If the C<fake> option is passed, C<$dir> isn't checked to be a valid C<git> repository.
return 1;
}
-=head2 C<run $conf, @args>
+=head2 C<run>
+
+ my $code = $arr->run($conf, @args);
Runs C<git @args> on the repository for the L<App::Rgit::Config> configuration C<$conf>.
When the repository isn't fake, the format substitutions applies to C<@args> elements.
=head1 FUNCTIONS
-=head2 C<abs_path $path>
+=head2 C<abs_path>
+
+ my $absolute_path = abs_path($path);
Forcefully make a path C<$path> absolute (in L<Cwd/abs_path>'s meaning of the term) when it isn't already absolute or when it contains C<'..'>.
=head1 CONSTANTS
-=head2 C<NEXT>, C<REDO>, C<LAST>, C<SAVE>
+=head2 C<NEXT>
+
+=head2 C<REDO>
+
+=head2 C<LAST>
+
+=head2 C<SAVE>
Codes to return from the C<report> callback to respectively proceed to the next repository, retry the current one, end it all, and save the return code.
LAST => 0x8,
};
-=head2 C<DIAG>, C<INFO>, C<WARN>, C<ERR> and C<CRIT>
+=head2 C<DIAG>
+
+=head2 C<INFO>
+
+=head2 C<WARN>
+
+=head2 C<ERR>
+
+=head2 C<CRIT>
Message levels.