Skip to content

Commit

Permalink
Merge branch 'release/0.90'
Browse files Browse the repository at this point in the history
  • Loading branch information
gugod committed Jan 29, 2021
2 parents 73b6f5f + 0004a17 commit 0d596b3
Show file tree
Hide file tree
Showing 42 changed files with 1,265 additions and 1,150 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: coverage

on:
push:
branches:
- develop

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
perl: [ '5.32' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- run: cpanm --quiet --notest --installdeps .
- run: cpanm --quiet --notest App::Yath Devel::Cover Devel::Cover::Report::Coveralls
- run: PERL5OPT=-MDevel::Cover yath test --qvf t/
- run: cover -report coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/yath.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: yath

on: pull_request

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
perl: [ '5.32', '5.30' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- run: perl -V
- run: cpanm --quite --notest --installdeps .
- run: cpanm --quite --notest App::Yath
- run: yath test --qvf t/
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This Build.PL for App-perlbrew was generated by mbtiny 0.027.
# This Build.PL for App-perlbrew was generated by mbtiny 0.028.
use 5.006;
use Module::Build::Tiny 0.034;
Build_PL();
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.90
- Released at 2021-01-29T09:43:17+0900
- Thanks to our contributors: Mose Schmiedel, gucchisk
- The output of 'available' command is split into sections of different type of distributions. Github issue #646.
- Let the output of `perlbrew -h` be the short usage. Github issue #647
- Unbreak env script for fish users. GitHub PR #698 and #708
- Prefer https URLs of www.cpan.org

0.89
- Released at 2020-10-19T09:26:19+0900
- Thanks to our contributors: Håkon Hægland, Nicolas R, Peter Tripp
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This software is Copyright (c) 2020 by Kang-min Liu C<< <gugod@gugod.org> >>.
This software is Copyright (c) 2021 by Kang-min Liu C<< <gugod@gugod.org> >>.

This is free software, licensed under:

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
^tools/
\.svn/
\.git/
\.github/
^[^/]+\.yaml$
^[^/]+\.pl$
^\.shipit$
Expand Down
6 changes: 2 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ NAME
PROJECT DEVELOPMENT

perlbrew project <https://perlbrew.pl/> uses github
https://github.com/gugod/App-perlbrew/issues and RT
<https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
tracking. Issues sent to these two systems will eventually be reviewed
and handled.
https://github.com/gugod/App-perlbrew/issues for issue tracking. Issues
sent to these two systems will eventually be reviewed and handled.

See https://github.com/gugod/App-perlbrew/contributors for a list of
project contributors.
Expand Down
4 changes: 2 additions & 2 deletions cpanfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
requires 'CPAN::Perl::Releases' => '5.20200920';
requires 'CPAN::Perl::Releases' => '5.20210123';
requires 'Capture::Tiny' => '0.36';
requires 'Devel::PatchPerl' => '2.00';
requires 'Devel::PatchPerl' => '2.08';
requires 'Pod::Parser' => '1.63';
requires 'Pod::Usage' => '1.68';
requires 'File::Copy' => '0';
Expand Down
1 change: 1 addition & 0 deletions dev-bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

SHELL=/bin/bash
eval "$(perlbrew init-in-bash)"
# source $HOME/perl5/perlbrew/etc/bashrc

Expand Down
74 changes: 35 additions & 39 deletions lib/App/Perlbrew/Path.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use strict;
use warnings;

Expand All @@ -9,112 +8,109 @@ require File::Glob;
require File::Path;

use overload (
'""' => \& stringify,
fallback => 1,
'""' => \& stringify,
fallback => 1,
);

sub _joinpath {
for my $entry(@_) {
for my $entry (@_) {
no warnings 'uninitialized';
die 'Received an undefined entry as a parameter (all parameters are: '. join(', ', @_). ')' unless (defined($entry));
}
return join "/", @_;
}

sub _child {
my ($self, $package, @path) = @_;
my ($self, $package, @path) = @_;

$package->new ($self->{path}, @path);
$package->new($self->{path}, @path);
}

sub _children {
my ($self, $package) = @_;
my ($self, $package) = @_;

return map $package->new ($_),
File::Glob::bsd_glob ($self->child ("*"))
;
return map $package->new($_),
File::Glob::bsd_glob($self->child("*"))
}

sub new {
my ($class, @path) = @_;
my ($class, @path) = @_;

bless { path => _joinpath (@path) }, $class;
bless { path => _joinpath (@path) }, $class;
}

sub basename {
my ($self, $suffix) = @_;
my ($self, $suffix) = @_;

return scalar File::Basename::fileparse ($self, ($suffix) x!! defined $suffix);
return scalar File::Basename::fileparse ($self, ($suffix) x!! defined $suffix);
}

sub child {
my ($self, @path) = @_;
my ($self, @path) = @_;

return $self->_child (__PACKAGE__, @path);
return $self->_child(__PACKAGE__, @path);
}

sub children {
my ($self) = @_;
my ($self) = @_;

return $self->_children (__PACKAGE__);
return $self->_children(__PACKAGE__);
}

sub dirname {
my ($self) = @_;
my ($self) = @_;

return App::Perlbrew::Path->new (File::Basename::dirname ($self));
return App::Perlbrew::Path->new(File::Basename::dirname ($self));
}

sub mkpath {
my ($self) = @_;
my ($self) = @_;
File::Path::mkpath ([$self->stringify], 0, 0777);
return $self;
return $self;
}

sub readlink {
my ($self) = @_;
my ($self) = @_;

my $link = readlink $self->stringify;
$link = __PACKAGE__->new ($link) if defined $link;
my $link = readlink $self->stringify;
$link = __PACKAGE__->new($link) if defined $link;

return $link;
return $link;
}

sub rmpath {
my ($self) = @_;
my ($self) = @_;
File::Path::rmtree([$self->stringify], 0, 0);
return $self;
return $self;
}

sub stringify {
my ($self) = @_;
my ($self) = @_;

return $self->{path};
return $self->{path};
}

sub stringify_with_tilde {
my ($self) = @_;
my $path = $self->stringify;
my $path = $self->stringify;
my $home = $ENV{HOME};
$path =~ s!\Q$home/\E!~/! if $home;
return $path;
}

sub symlink {
my ($self, $destination, $force) = @_;
$destination = App::Perlbrew::Path->new ($destination)
unless ref $destination;
my ($self, $destination, $force) = @_;
$destination = App::Perlbrew::Path->new($destination) unless ref $destination;

CORE::unlink $destination
if $force && (-e $destination || -l $destination);
CORE::unlink $destination if $force && (-e $destination || -l $destination);

$destination if CORE::symlink $self, $destination;
$destination if CORE::symlink $self, $destination;
}

sub unlink {
my ($self) = @_;
my ($self) = @_;

CORE::unlink ($self);
CORE::unlink ($self);
}

1;
Expand Down
11 changes: 5 additions & 6 deletions lib/App/Perlbrew/Path/Installation.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use strict;
use warnings;

Expand All @@ -9,23 +8,23 @@ require App::Perlbrew::Path;
our @ISA = qw( App::Perlbrew::Path );

sub name {
$_[0]->basename;
$_[0]->basename;
}

sub bin {
shift->child (bin => @_);
shift->child(bin => @_);
}

sub man {
shift->child (man => @_);
shift->child(man => @_);
}

sub perl {
shift->bin ('perl');
shift->bin('perl');
}

sub version_file {
shift->child ('.version');
shift->child('.version');
}

1;
Expand Down
15 changes: 7 additions & 8 deletions lib/App/Perlbrew/Path/Installations.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use strict;
use warnings;

Expand All @@ -10,21 +9,21 @@ require App::Perlbrew::Path::Installation;
our @ISA = qw( App::Perlbrew::Path );

sub child {
my ($self, @params) = @_;
my ($self, @params) = @_;

my $return = $self;
$return = $return->_child ('App::Perlbrew::Path::Installation' => shift @params) if @params;
$return = $return->child (@params) if @params;
my $return = $self;
$return = $return->_child('App::Perlbrew::Path::Installation' => shift @params) if @params;
$return = $return->child(@params) if @params;

$return;
$return;
}

sub children {
shift->_children ('App::Perlbrew::Path::Installation' => @_);
shift->_children('App::Perlbrew::Path::Installation' => @_);
}

sub list {
shift->children;
shift->children;
}

1;
Expand Down
17 changes: 8 additions & 9 deletions lib/App/Perlbrew/Path/Root.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use strict;
use warnings;

Expand All @@ -10,28 +9,28 @@ require App::Perlbrew::Path::Installations;
our @ISA = qw( App::Perlbrew::Path );

sub bin {
shift->child (bin => @_);
shift->child(bin => @_);
}

sub build {
shift->child (build => @_);
shift->child(build => @_);
}

sub dists {
shift->child (dists => @_);
shift->child(dists => @_);
}

sub etc {
shift->child (etc => @_);
shift->child(etc => @_);
}

sub perls {
my ($self, @params) = @_;
my ($self, @params) = @_;

my $return = $self->_child ('App::Perlbrew::Path::Installations', 'perls');
$return = $return->child (@params) if @params;
my $return = $self->_child('App::Perlbrew::Path::Installations', 'perls');
$return = $return->child(@params) if @params;

return $return;
return $return;
}

1;
Expand Down
Loading

0 comments on commit 0d596b3

Please sign in to comment.