App-gh
view release on metacpan or search on metacpan
lib/App/gh/Command/Search.pm view on Meta::CPAN
for my $repo ( @{ $data->{repositories} } ) {
my $name = sprintf "%s/%s", $repo->{username} , $repo->{name};
my $desc = $repo->{description};
push @ary, [ $name , $desc || '' ];
}
print_list @ary;
# my $result = App::gh->api->search($keyword);
# if( $self->{long} ) {
# for my $entry ( @{ $result->{repositories} } ) {
# print color 'white bold';
# say "* $entry->{owner}/$entry->{name}";
# print color 'reset';
# say " W/F: $entry->{watchers}/$entry->{forks}";
# say " Url: " . $entry->{url} if $entry->{url};
# say " Homepage: " . $entry->{homepage} if $entry->{homepage};
# say "\n" . wrap( ' ', ' ', $entry->{description} ) . "\n";
# }
# } else {
# my @ary = ();
# for my $repo ( @{ $result->{repositories} } ) {
lib/App/gh/Utils.pm view on Meta::CPAN
my $screen_width = 92;
for my $arg ( @lines ) {
my $title = shift @$arg;
my $padding = int($column_w) - length( $title );
if ( $ENV{WRAP} && ( $column_w + 3 + length( join(" ",@$arg)) ) > $screen_width ) {
# wrap description
my $string =
color('bold') .
$title .
color('reset') .
" " x $padding . " - " . join(" ",@$arg) . "\n";
$string =~ s/\n//g;
my $cnt = 0;
my $firstline = 1;
my $tab = 4;
my $wrapped = 0;
lib/App/gh/Utils.pm view on Meta::CPAN
elsif( $c =~ /[ \,]/ && ! $firstline && $cnt > ($screen_width - $column_w) ) {
print "\n" . " " x ($column_w + 3 + $tab );
$cnt = 0;
$wrapped = 1;
}
}
print "\n";
print "\n" if $wrapped;
}
else {
print color 'bold';
print $title;
print color 'reset';
print " " x $padding;
print " - ";
$$arg[0] = ' ' unless $$arg[0];
print join " " , @$arg;
print "\n";
}
}
lib/App/gh/Utils.pm view on Meta::CPAN
sub info {
my @msg = @_;
print STDERR color 'green';
print STDERR join("\n", @msg), "\n";
print STDERR color 'reset';
}
sub notice {
my @msg = @_;
print STDERR color 'bold yellow';
print STDERR join("\n", @msg), "\n";
print STDERR color 'reset';
}
#
# @param string $remote git remote name
# @param hashref $options
# @return string command output
sub run_git_fetch {
( run in 1.190 second using v1.01-cache-2.11-cpan-fe3c2283af0 )