Tuesday, May 19, 2009

github instead of google code

yes. I do love github more than google code. it's not the problem of git or svn. svn is fine.

the point is participation.
In google code, it's very hard to contribute some code to one project if you're not the author. it disappoints me a lot.
The "fork" button in github is very helpful. people forked my repos then pull requests to ask me to merge (like perl-net-github, dist-zilla-plugin-repository). I forked someone's repos then pull back (like theschwartz-moosified, dist-zilla, git-pureperl etc).

it's awesome. go start using github right now. :)

Labels:

Monday, April 20, 2009

App::GitHub

well, App::GitHub is a command line tool wrapped by Net::GitHub.

for a brief view:
$> github.pl

Welcome to GitHub Command Tools! (Ver: 0.04)
Type '?' or 'h' for help.

github> ?
command argument description
repo :user :repo set owner/repo, eg: 'fayland perl-app-github'
login :login :token authenticated as :login
loadcfg authed by git config --global github.user|token
?,h help
q,exit,quit exit

Repos
rshow more in-depth information for the :repo in repo
rlist list out all the repositories for the :user in repo
rsearch WORD Search Repositories
watch watch repositories (authentication required)
unwatch unwatch repositories (authentication required)
fork fork a repository (authentication required)
create create a new repository (authentication required)
delete delete a repository (authentication required)
set_private set a public repo private (authentication required)
set_public set a private repo public (authentication required)
network see all the forks of the repo
tags tags on the repo
branches list of remote branches

Issues
ilist open|closed see a list of issues for a project
iview :number get data on an individual issue by number
iopen open a new issue (authentication required)
iclose :number close an issue (authentication required)
ireopen :number reopen an issue (authentication required)
iedit :number edit an issue (authentication required)
ilabel add|remove :num :label
add/remove a label (authentication required)

File/Path related
cd PATH chdir to PATH

Others
rshow :user :repo more in-depth information for a repository
rlist :user list out all the repositories for a user

github> loadcfg

github> repo fayland perl-app-github

fayland/perl-app-github> rshow
{
"owner" : "fayland",
"private" : false,
"name" : "perl-app-github",
"description" : "App::GitHub CPAN module",
"homepage" : "",
"watchers" : 2,
"forks" : 0,
"fork" : false,
"url" : "http://github.com/fayland/perl-app-github"
}

fayland/perl-app-github> repo fayland sandbox2

fayland/sandbox2> ilist
[
{
"number" : 1,
"position" : 1,
"state" : "open",
"body" : "Test Issue body.",
"created_at" : "2009/04/19 06:08:30 -0700",
"updated_at" : "2009/04/19 06:09:17 -0700",
"user" : "fayland",
"title" : "Test Issue",
"votes" : 0
},
{
"number" : 2,
"position" : 2,
"state" : "open",
"body" : "new test 3\nnew test 2",
"created_at" : "2009/04/19 18:44:49 -0700",
"updated_at" : "2009/04/19 18:50:44 -0700",
"user" : "fayland",
"title" : "new test 2",
"votes" : 0
},
{
"number" : 3,
"position" : 3,
"state" : "open",
"body" : "s",
"created_at" : "2009/04/19 18:51:17 -0700",
"updated_at" : "2009/04/19 18:51:31 -0700",
"user" : "fayland",
"title" : "sssssssss",
"votes" : 0
}
]

fayland/sandbox2> q

for now, there are ONLY repos and issue related command. but I would add more in next few days.

Thanks and Enjoy.

Labels:

Sunday, April 19, 2009

Net::GitHub 0.06

github just released its V2 API version days ago, I spent some hours to update the Net::GitHub.

it's really not a fun to both support V1 and V2 on the same time, I mean some code like follows:
use Net::GitHub;
my $g2 = Net::GitHub->new( version => 2 ); # use Net::GitHub::V2
my $g2 = Net::GitHub->new( version => 1 ); # use Net::GitHub::V1

after a nice sleep, I come out a solution like:
package Net::GitHub;

use Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';

sub new {
my $class = shift;
my $params = $class->BUILDARGS(@_);

my $obj;
if ( $params->{version} == 1 ) {
require Net::GitHub::V1;
$obj = Net::GitHub::V1->new($params);
} else {
require Net::GitHub::V2;
$obj = Net::GitHub::V2->new($params);
}

return $class->meta->new_object(
__INSTANCE__ => $obj,
@_,
);
}

no Moose;
__PACKAGE__->meta->make_immutable;

1;

maybe there is a better way, but it works at least for now.

Thanks and enjoy.

Labels: ,