Compare commits
2 Commits
b7938c3931
...
ac929cff82
Author | SHA1 | Date |
---|---|---|
Zane C. B-H | ac929cff82 | |
Zane C. B-H | b6242ac20e |
|
@ -1,5 +1,9 @@
|
||||||
Revision history for Git-PunchCard
|
Revision history for Git-PunchCard
|
||||||
|
|
||||||
|
0.1.0 2019-07-15/22:15
|
||||||
|
- Display max.
|
||||||
|
- Add avagerage/min.
|
||||||
|
|
||||||
0.0.1 2019-07-15/06:20
|
0.0.1 2019-07-15/06:20
|
||||||
- Set LC_ALL=C when calling git.
|
- Set LC_ALL=C when calling git.
|
||||||
- Properly set hourly max for the day.
|
- Properly set hourly max for the day.
|
||||||
|
|
|
@ -129,7 +129,10 @@ my $table=Text::Table->new(
|
||||||
'21',
|
'21',
|
||||||
'22',
|
'22',
|
||||||
'23',
|
'23',
|
||||||
'Total'
|
'Total',
|
||||||
|
'Max',
|
||||||
|
'Avg',
|
||||||
|
'Min'
|
||||||
);
|
);
|
||||||
|
|
||||||
my $card=$gpc->get_card;
|
my $card=$gpc->get_card;
|
||||||
|
@ -145,14 +148,28 @@ foreach my $day ( @days ){
|
||||||
push( @line, color($colors[$color_to_use]).$card->{$day}{$hour}.color('WHITE') );
|
push( @line, color($colors[$color_to_use]).$card->{$day}{$hour}.color('WHITE') );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $min_color=13*($card->{$day}{min}/$card->{max});
|
||||||
|
my $average_color=13*($card->{$day}{average}/$card->{max});
|
||||||
|
my $max_color=13*($card->{$day}{max}/$card->{max});
|
||||||
|
|
||||||
push( @line, $card->{$day}{total}.color('WHITE') );
|
push( @line, $card->{$day}{total}.color('WHITE') );
|
||||||
|
push( @line, color($colors[$max_color]).$card->{$day}{max}.color('WHITE') );
|
||||||
|
push( @line, color($colors[$average_color]).sprintf('%.1f',$card->{$day}{average}).color('WHITE') );
|
||||||
|
push( @line, color($colors[$min_color]).$card->{$day}{min}.color('WHITE') );
|
||||||
|
|
||||||
push( @data, \@line );
|
push( @data, \@line );
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->load( @data );
|
$table->load( @data );
|
||||||
|
|
||||||
print $table."\nTotal: ".$card->{total}."\nHourly Max=".$card->{max}."\n";
|
my $min_color=13*($card->{min}/$card->{max});
|
||||||
|
my $average_color=13*($card->{average}/$card->{max});
|
||||||
|
|
||||||
|
print $table.
|
||||||
|
"\nTotal: ".$card->{total}.
|
||||||
|
"\nMax=".color($colors[13]).$card->{max}.color('WHITE').
|
||||||
|
"\nAverage=".color($colors[$average_color]).sprintf("%.1f",$card->{average}).color('WHITE').
|
||||||
|
"\nMin=".color($colors[$min_color]).$card->{min}.color('WHITE')."\n";
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ Git::PunchCard - Gathers info for making punchcard style graphs for git.
|
||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
Version 0.0.1
|
Version 0.1.0
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
our $VERSION = '0.0.1';
|
our $VERSION = '0.1.0';
|
||||||
|
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
@ -98,9 +98,13 @@ sub new {
|
||||||
card=>{
|
card=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
Sun=>{
|
Sun=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -129,6 +133,8 @@ sub new {
|
||||||
Mon=>{
|
Mon=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -157,6 +163,8 @@ sub new {
|
||||||
Tue=>{
|
Tue=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -185,6 +193,8 @@ sub new {
|
||||||
Wed=>{
|
Wed=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -213,6 +223,8 @@ sub new {
|
||||||
Thu=>{
|
Thu=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -241,6 +253,8 @@ sub new {
|
||||||
Fri=>{
|
Fri=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -269,6 +283,8 @@ sub new {
|
||||||
Sat=>{
|
Sat=>{
|
||||||
total=>0,
|
total=>0,
|
||||||
max=>0,
|
max=>0,
|
||||||
|
average=>0,
|
||||||
|
min=>9999999999999999999999999999999999,
|
||||||
'00'=>0,
|
'00'=>0,
|
||||||
'01'=>0,
|
'01'=>0,
|
||||||
'02'=>0,
|
'02'=>0,
|
||||||
|
@ -361,8 +377,24 @@ sub dir {
|
||||||
$self->{card}{$day}{max}=$self->{card}{$day}{$hour};
|
$self->{card}{$day}{max}=$self->{card}{$day}{$hour};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{card}{$day}{average}= $self->{card}{$day}{total} / 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{card}{average}= $self->{card}{total} / 168 ;
|
||||||
|
|
||||||
|
foreach my $day ( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ){
|
||||||
|
for my $hour ( '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23' ){
|
||||||
|
if ( $self->{card}{$day}{$hour} < $self->{card}{$day}{min} ){
|
||||||
|
$self->{card}{$day}{min}=$self->{card}{$day}{$hour};
|
||||||
|
}
|
||||||
|
if ( $self->{card}{$day}{$hour} < $self->{card}{min} ){
|
||||||
|
$self->{card}{min}=$self->{card}{$day}{$hour};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Loading…
Reference in New Issue