Git::PunchCard - Gathers info for making punchcard style graphs for git.
Version 0.1.0
Quick summary of what the module does.
Perhaps a little code snippet.
use Git::PunchCard; use Data::Dumper; use Text::Table; my $gpc = Git::PunchCard->new(); $gpc->dir($some_git_repo_dir); if ( $gpc->error ){ print "Could not process the directory.\n"; } my $card=$gpc->get_card; print Dumper( $card ); # The various keys for the hashes. my @days=('Sun','Mon','Tue','Wed','Thu','Fri','Sat', ); my @hours=('00','01','02','03','04','05','06','07','08','09','10', '11','12','13','14','15','16','17','18','19','20','21','22','23'); # Stores the lines to for the table. my @data; # Process each day hash in $card. foreach my $day ( @days ){ my @line; # Add the day coloumn to the current line of the table. push( @line, $day ); # Add each hour entry to the current line of the table. foreach my $hour ( @hours ){ push( @line, $card->{$day}{$hour} ); } # Finally add the total number of entries for that day. push( @line, $card->{$day}{total}.color('WHITE') ); # add the new line to the table data push( @data, \@line ); } # Init the Text::Table object and add our headers. my $table=Text::Table->new('','00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','Total'); # Loads the data into the table $table->load( @data ); # produce some useful? output print $table."\nTotal: ".$card->{total}."\n";
Inits the object.
my $gpc->new;
One argument is taken and that is the directory to parse in.
If one is not passed, the current directory will be used.
IF this is called multiple times, each new instance will be added to the current values.
$gpc->dir( $dir ) if ( $gpc->error ){ print "Errored!\n"; }
This returns the current card data.
The returned value is a hashref.
The first level keys are the three letter day names the the second level keys are the two digit hour.
There are two special keys 'total', 'max', min, and avagerage.
'total' represents the total level of commits. So at the primary level it is all the commits made to that repo while and the secondary level it is all the comits made to that repo on that day of the week.
'max' is the largest number of commits made. At the primary level it is any hour on any day of the week while at the secondary level it is the max made during any given hour that day.
'min' and 'average' is similar as max, but representing the min and average instead.
For examples of making use of this, see the SYNOPSIS or check out the script punchard-git.
my $card=$gpc->get_card;
Error handling is provided by Error::Helper.
Git exited with a non-zero value.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-git-punchcard at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Git-PunchCard. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-git-punchcard at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Git::PunchCard
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-PunchCard
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Git-PunchCard
CPAN Ratings
https://cpanratings.perl.org/d/Git-PunchCard
Search CPAN
https://metacpan.org/release/Git-PunchCard
Primary Repo
https://gitea.eesdp.org/vvelox/Git-PunchCard/
This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =head
To install Git::PunchCard, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::PunchCard
CPAN shell
perl -MCPAN -e shell install Git::PunchCard
For more information on module installation, please visit the detailed CPAN module installation guide.