Skip to content

Commit 60f4d35

Browse files
committed
Completed the minicpan backend
1 parent d2a2bf1 commit 60f4d35

File tree

8 files changed

+58
-11
lines changed

8 files changed

+58
-11
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changes for Perl extension Portable.
22

3+
0.11 Wed 2 Jul 2008
4+
- Debugged the minicpan backend to the point where it will
5+
actually build and install properly.
6+
37
0.10 Wed 2 Jul 2008
48
- Working on a proper implementation of the minicpan backend.
59
- Added missing test_requires Test::Exception.

lib/CPAN/Mini/Portable.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ use warnings;
66
use Portable ();
77
use CPAN::Mini ();
88

9-
our $VERSION = '0.10';
9+
our $VERSION = '0.11';
1010
our @ISA = 'CPAN::Mini';
1111

1212
sub new {
13-
# Use the portable values as defaults
14-
my $portable = Portable->default->portable;
13+
# Use the portable values as defaults,
14+
# completely ignoring any passed params
15+
my $minicpan = Portable->default->minicpan;
1516

1617
# Hand off to the parent class
17-
my $class = shift;
18-
return $class->SUPER::new( %$portable, @_ );
18+
return $_[0]->SUPER::new( %$minicpan );
1919
}
2020

2121
1;

lib/Portable.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ more details on how it works...
5454
use 5.008;
5555
use strict;
5656
use warnings;
57-
# use feature 'state';
5857
use Carp ();
5958
use File::Spec ();
6059
use List::Util ();
6160
use Parse::CPAN::Meta ();
6261

63-
our $VERSION = '0.10';
62+
our $VERSION = '0.11';
6463

6564
# This variable is provided exclusively for the
6665
# use of test scripts.

lib/Portable/CPAN.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use warnings;
66
use Carp ();
77

8-
our $VERSION = '0.10';
8+
our $VERSION = '0.11';
99

1010
# Create the enumerations
1111
our %bin = map { $_ => 1 } qw{

lib/Portable/Config.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use warnings;
66
use Carp ();
77
use File::Spec ();
88

9-
our $VERSION = '0.10';
9+
our $VERSION = '0.11';
1010

1111

1212

lib/Portable/HomeDir.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use Carp ();
99
use Scalar::Util ();
1010
use File::HomeDir::Driver ();
1111

12-
our $VERSION = '0.10';
12+
our $VERSION = '0.11';
1313

1414

1515

lib/Portable/minicpan.pm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use warnings;
66
use Carp ();
77

8-
our $VERSION = '0.10';
8+
our $VERSION = '0.11';
99

1010

1111

@@ -41,6 +41,17 @@ sub new {
4141
);
4242
}
4343

44+
# Add the literal params
45+
foreach my $key ( qw{
46+
remote
47+
quiet force offline
48+
also_mirror exact_mirror
49+
module_filters path_filters
50+
skip_cleanup skip_perl
51+
} ) {
52+
$self->{$key} = $minicpan->{$key};
53+
}
54+
4455
return $self;
4556
}
4657

t/05_minicpan.t

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/perl
2+
3+
use strict;
4+
BEGIN {
5+
$| = 1;
6+
$^W = 1;
7+
}
8+
9+
use Test::More tests => 3;
10+
use File::Spec::Functions ':ALL';
11+
12+
# Override the perl path for testing purposes
13+
$Portable::FAKE_PERL =
14+
$Portable::FAKE_PERL = rel2abs(
15+
catfile( qw{
16+
t data perl bin perl.exe
17+
} )
18+
);
19+
20+
# Create a default object
21+
use_ok( 'CPAN::Mini::Portable' );
22+
my $object = CPAN::Mini::Portable->new(
23+
'local' => 1,
24+
'remote' => 1,
25+
);
26+
isa_ok( $object, 'CPAN::Mini::Portable' );
27+
is(
28+
$object->{remote},
29+
'http://cpan.strawberryperl.com/',
30+
'->remote ok',
31+
);
32+
33+
1;

0 commit comments

Comments
 (0)