App-git-ship

 view release on metacpan or  search on metacpan

lib/App/git/ship.pm  view on Meta::CPAN

  my $repository;

  open my $REPOSITORIES, '-|', qw(git remote -v) or $self->abort("git remote -v: $!");
  while (<$REPOSITORIES>) {
    next unless /^origin\s+(\S+).*push/;
    $repository = $1;
    last;
  }

  $repository ||= lc sprintf 'https://github.com/%s/%s',
    $self->config('username') || $ENV{GITHUB_USERNAME} || scalar(getpwuid $<),
    $self->config('project_name') =~ s!::!-!gr;
  $repository =~ s!^[^:]+:!https://github.com/! unless $repository =~ /^http/;
  warn "[ship::repository] $repository\n" if DEBUG;

  return $repository;
}

sub _get_template {
  my ($self, $name) = @_;

t/perl-start.t  view on Meta::CPAN

use lib '.';
use t::Util;
use App::git::ship;

my $git_ship = File::Spec->catfile(Cwd::getcwd, 'bin', 'git-ship');
my $git_ship_lib = File::Spec->catfile(Cwd::getcwd, 'lib');
t::Util->goto_workdir('perl-start', 0);

my $username = getpwuid $<;
my $workdir  = Cwd::getcwd;

my $app = App::git::ship->new;
$app = $app->start('Perl/Start.pm', 0);

isa_ok($app, 'App::git::ship::perl');
isnt $workdir, Cwd::getcwd, 'chdir after start()';
ok -d '.git', '.git was created';
ok -e $app->config('main_module_path'), 'main module was touched';

t/repository.t  view on Meta::CPAN

use lib '.';
use t::Util;
use App::git::ship;

t::Util->goto_workdir('repository');

my $app = App::git::ship->new(silent => $ENV{HARNESS_IS_VERBOSE} ? 0 : 1);
my $username = getpwuid $<;

delete $app->{repository};
$app->start;
is $app->config('repository'), "https://github.com/$username/unknown", 'unknown repository';

delete $app->{repository};
system qw(git remote add origin https://github.com/harry-bix/mojo-MySQL5.git);
is $app->config('repository'), 'https://github.com/harry-bix/mojo-MySQL5.git', 'http repository';

delete $app->{repository};



( run in 0.538 second using v1.01-cache-2.11-cpan-8d75d55dd25 )