From: Ken-ichi Mito Date: Wed, 21 Aug 2013 02:02:55 +0000 (+0900) Subject: check repository response parameters X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=f38b66d105e866ad030cb8a55b5fd28d13434293;p=lab.git check repository response parameters --- diff --git a/Dev/github/GitHubBackup.pm b/Dev/github/GitHubBackup.pm index 73cf1d4..c202d1a 100644 --- a/Dev/github/GitHubBackup.pm +++ b/Dev/github/GitHubBackup.pm @@ -166,6 +166,22 @@ sub full_name { return (shift)->{repos}{full_name}; } +sub has_downloads { + return (shift)->{repos}{has_downloads}; +} + +sub forks_count { + return (shift)->{repos}{forks_count}; +} + +sub has_wiki { + return (shift)->{repos}{has_wiki}; +} + +sub has_issues { + return (shift)->{repos}{has_issues}; +} + sub directory { my $self = shift; @@ -294,10 +310,10 @@ sub save_issues { sub backup { my $self = shift; - $self->clone_git; - $self->set_forks; - $self->clone_wiki; - $self->save_issues; + $self->clone_git if ($self->has_downloads eq 'true'); + $self->set_forks if ($self->forks_count > 0); + $self->clone_wiki if ($self->has_wiki eq 'true'); + $self->save_issues if ($self->has_issues eq 'true'); return $self; }