Changeset b8d7413 in lab.git for Dev/github


Ignore:
Timestamp:
Aug 18, 2013 4:02:01 AM (11 years ago)
Author:
Ken-ichi Mito <mitty@…>
Branches:
master
Children:
19df400
Parents:
19233f5
Message:

remove super and give closure for $self->directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/github/GitHubBackup.pm

    r19233f5 rb8d7413  
    5858        $self->{repos} = [ 
    5959            GitHubBackup::Repository->new({ 
    60                 __super   => $self, 
     60                directory => sub {$self->directory}, 
    6161                full_name => "$account/$repository", 
    6262            }) 
     
    8282        push @{$self->{repos}}, 
    8383            GitHubBackup::Repository->new({ 
    84                 __super   => $self, 
     84                directory => sub {$self->directory}, 
    8585                full_name => $repos->{full_name}, 
    8686                clone_url => $repos->{clone_url}, 
     
    103103use File::chdir; 
    104104 
     105 
    105106sub new { 
    106107    my $class = shift; 
     
    115116} 
    116117 
     118sub directory { 
     119    my $self = shift; 
     120     
     121    return $self->{directory}->(); 
     122} 
     123 
    117124sub clone_git { 
    118125    my $self = shift; 
    119126     
    120     my $dir = $self->{__super}->directory .'/'. $self->{full_name}; 
     127    my $dir = $self->directory .'/'. $self->{full_name}; 
    121128    if (-d "$dir") { 
    122129        local $CWD = $dir; 
Note: See TracChangeset for help on using the changeset viewer.