Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rthik committed Nov 20, 2013
2 parents d2cdf42 + a80032b commit 978ddb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ WriteMakefile(
( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ( 'LICENSE' => 'mit' ) : () ),
EXE_FILES => [ 'git-cal', ],
PL_FILES => {},
PREREQ_PM => { 'LWP::Simple' => 0, 'JSON::PP' => 0},
PREREQ_PM => {},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
);
31 changes: 4 additions & 27 deletions git-cal
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ use utf8;
use Getopt::Long;
use Pod::Usage;
use Time::Local;
use LWP::Simple;
use JSON::PP qw ( decode_json );
use Data::Dumper;

binmode(STDOUT, ":utf8");
#command line options
my ( $help, $period, $use_ascii, $use_ansi, $use_unicode, $format, $author, $filepath, $github_username );
my ( $help, $period, $use_ascii, $use_ansi, $use_unicode, $format, $author, $filepath );

GetOptions(
'help|?' => \$help,
'period|p=n' => \$period,
'ascii' => \$use_ascii,
'ansi' => \$use_ansi,
'unicode' => \$use_unicode,
'author=s' => \$author,
'github|gh=s' => \$github_username
'author=s' => \$author
) or pod2usage(2);

pod2usage(1) if $help;
Expand Down Expand Up @@ -61,32 +58,11 @@ sub process {
: 'ansi';
}
init_cal_stuff();
if ($github_username) {
process_github_contributions();
}
else {
process_current_repo();
}
process_current_repo();
my %stats = compute_stats();
print_grid(%stats);
}


sub process_github_contributions {
my $content = get("https://github.com/users/" . $github_username . "/contributions_calendar_data");
my $result = decode_json ( $content ) if $content;
if (!$content || !$result) {
print "fatal: could not get github contributions data of " . $github_username . "\n";
exit(1);
}
foreach my $contrib (@$result) {
next if !$contrib->[1];
my ( $year, $mon, $mday ) = split "/", $contrib->[0];
my $epoch = timelocal( 0, 0, 0, $mday, $mon-1, $year );
add_epoch( $epoch, $contrib->[1] );
}
}

sub process_current_repo {
my $git_command = git_command();
my @epochs = qx/$git_command/;
Expand Down Expand Up @@ -454,6 +430,7 @@ Shows only one month (1=Jan .. 12=Dec)
Shows the last n months (and the current month)
<<<<<<< HEAD
=back
=item --author=<author>
Expand Down

0 comments on commit 978ddb0

Please sign in to comment.