###########################################
package GitMeta::SshDir;
###########################################
# 2010, Mike Schilli <m@perlmeister.com>
###########################################
use strict;
use warnings;
use base qw(GitMeta);
use Sysadm::Install qw(:all);
use Log::Log4perl qw(:easy);

###########################################
sub expand {
###########################################
  my($self) = @_;

  $self->param_check("host", "dir");

  INFO "Retrieving repos ",
       "from $self->{host}";

  my($stdout) = tap "ssh", $self->{host}, 
     "ls", $self->{dir};

  my @repos = ();

  while( $stdout =~ /(.*)\n/g ) {
      push @repos, 
        "$self->{host}:$self->{dir}/$1";
  }

  return @repos;
}

1;
