Changeset 15025
- Timestamp:
- Sep 25, 2007, 2:13:29 PM (19 years ago)
- Location:
- trunk/DataStore
- Files:
-
- 3 edited
-
MANIFEST (modified) (1 diff)
-
lib/DataStore/Product/Parser.pm (modified) (5 diffs)
-
lib/DataStore/Root.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/MANIFEST
r15019 r15025 37 37 t/12_dsfilesetls.t 38 38 t/13_dsrootls.t 39 t/14_root.t -
trunk/DataStore/lib/DataStore/Product/Parser.pm
r7951 r15025 3 3 # Copyright (C) 2006 Joshua Hoblitt 4 4 # 5 # $Id: Parser.pm,v 1. 1 2006-07-22 01:17:34 smalleExp $5 # $Id: Parser.pm,v 1.2 2007-09-26 00:13:29 jhoblitt Exp $ 6 6 7 7 package DataStore::Product::Parser; … … 34 34 35 35 my $parser = DataStore::Product::Parser->new( 36 base_uri => 'http://example.org/ ',36 base_uri => 'http://example.org/index.txt', 37 37 ); 38 38 … … 63 63 64 64 my $parser = DataStore::Product::Parser->new( 65 base_uri => 'http://example.org/ ',65 base_uri => 'http://example.org/index.txt', 66 66 ); 67 67 … … 91 91 'is valid http uri' => 92 92 sub { is_uri($_[0]) and $_[0] =~ /^http:/ }, 93 'uri ends with /' => sub { $_[0] =~ m|/$| }, 93 'uri ends with /index.txt' => 94 sub { $_[0] =~ m|/index.txt$| }, 95 94 96 }, 95 default => 'http://example.org/ ',97 default => 'http://example.org/index.txt', 96 98 }, 97 99 }, 98 100 ); 99 101 100 my $self = bless \%p, ref $class || $class; 102 my $self = bless {}, ref $class || $class; 103 104 $p{base_uri} =~ qr|(.*?/)index.txt|; 105 $self->{base_uri} = $1; 101 106 102 107 return $self; … … 188 193 type => $type, 189 194 desc => $desc, 190 uri => $self->base_uri . $product . '/ ',195 uri => $self->base_uri . $product . '/index.txt', 191 196 }); 192 197 } continue { -
trunk/DataStore/lib/DataStore/Root.pm
r8144 r15025 3 3 # Copyright (C) 2006 Joshua Hoblitt 4 4 # 5 # $Id: Root.pm,v 1. 3 2006-08-04 22:18:04 smalleExp $5 # $Id: Root.pm,v 1.4 2007-09-26 00:13:29 jhoblitt Exp $ 6 6 7 7 package DataStore::Root; … … 16 16 17 17 use Carp qw( carp ); 18 use DataStore:: FileSet::Parser;18 use DataStore::Product::Parser; 19 19 use DataStore::Record; 20 20 use DataStore::Response; … … 94 94 type => SCALAR, 95 95 callbacks => { 96 'is valid uri dirname' => sub { $_[0] =~ m|/$| }, 96 'uri ends with /index.txt' => 97 sub { $_[0] =~ m|/index.txt$| }, 97 98 } 98 99 },
Note:
See TracChangeset
for help on using the changeset viewer.
