App-GitHooks
view release on metacpan or search on metacpan
lib/App/GitHooks/StagedChanges.pm view on Meta::CPAN
package App::GitHooks::StagedChanges;
use strict;
use warnings;
# External dependencies.
use Carp qw( croak );
use Data::Dumper;
use Data::Validate::Type;
use File::Basename qw();
use Parallel::ForkManager qw();
use Path::Tiny qw();
use Try::Tiny;
# Internal dependencies.
use App::GitHooks::Constants qw( :PLUGIN_RETURN_CODES );
=head1 NAME
App::GitHooks::StagedChanged - Staged changes in git.
=head1 VERSION
Version 1.9.0
=cut
our $VERSION = '1.9.0';
=head1 METHODS
=head2 new()
Instantiate a new C<App::GitHooks::StagedChanges> object.
my $staged_changes = App::GitHooks::StagedChanges->new(
app => $app,
);
Arguments:
=over 4
=item * app I<(mandatory)>
An C<App::GitHook> instance.
=back
=cut
sub new
{
my ( $class, %args ) = @_;
my $app = delete( $args{'app'} );
# Check arguments.
croak 'An "app" argument is mandatory'
if !Data::Validate::Type::is_instance( $app, class => 'App::GitHooks' );
return bless(
{
app => $app,
},
$class,
);
}
=head2 get_app()
( run in 0.883 second using v1.01-cache-2.11-cpan-d8267643d1d )