File tree Expand file tree Collapse file tree 5 files changed +30
-0
lines changed Expand file tree Collapse file tree 5 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,4 @@ MYMETA.*
15
15
* .o
16
16
gitpan-build
17
17
t /gitpan
18
+ t /caches /
Original file line number Diff line number Diff line change @@ -788,7 +788,9 @@ committer_email: schwern+gitpan-test@pobox.com
788
788
overlays:
789
789
test:
790
790
backpan_always_update: 0
791
+ backpan_cache_dir: t/caches/backpan/
791
792
backpan_cache_ttl: 604800
793
+ backpan_index_url: file:t/backpan/backpan-index.gz
792
794
backpan_url: file:t/backpan/
793
795
794
796
github_owner: gitpan-test
Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ haz backpan_url =>
9
9
isa => URI,
10
10
default => ' http://gitpan.integra.net/backpan' ;
11
11
12
+ haz backpan_index_url =>
13
+ is => ' ro' ,
14
+ isa => URI,
15
+ default => ' http://gitpan.integra.net/backpan-index.gz' ;
16
+
17
+ haz backpan_cache_dir =>
18
+ is => ' ro' ,
19
+ isa => Maybe[AbsPath];
20
+
12
21
haz backpan_cache_ttl =>
13
22
is => ' ro' ,
14
23
isa => Int,
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ method _build_index {
41
41
push @opts , (normalize_releases => $config -> backpan_normalize_releases)
42
42
if keys %{$config -> backpan_normalize_releases};
43
43
44
+ push @opts , (cache_dir => $config -> backpan_cache_dir.' ' )
45
+ if defined $config -> backpan_cache_dir;
46
+
47
+ push @opts , (backpan_index_url => $config -> backpan_index_url)
48
+ if defined $config -> backpan_index_url;
49
+
44
50
return BackPAN::Index-> new(
45
51
cache_ttl => $self -> config-> backpan_cache_ttl,
46
52
releases_only_from_authors => 1,
Original file line number Diff line number Diff line change @@ -42,4 +42,16 @@ note "not shared across forks"; {
42
42
Test::More-> builder-> current_test( Test::More-> builder-> current_test + $child -> read );
43
43
}
44
44
45
+ note " test config" ; {
46
+ my $obj = Some::Class-> new;
47
+ my $bp = $obj -> backpan_index;
48
+
49
+ ok(" t" -> path-> subsumes($bp -> cache_dir-> path),
50
+ " backpan cache is in the t/ directory" )
51
+ or diag $bp -> cache_dir;
52
+
53
+ is $bp -> backpan_index_url-> scheme, " file" ;
54
+ is $bp -> backpan_index_url-> path, " t/backpan/backpan-index.gz" ;
55
+ }
56
+
45
57
done_testing;
You can’t perform that action at this time.
0 commit comments