IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15025


Ignore:
Timestamp:
Sep 25, 2007, 2:13:29 PM (19 years ago)
Author:
jhoblitt
Message:

convert DataStore::Root to use URIs that end as /index.txt$ instead of /$

Location:
trunk/DataStore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/MANIFEST

    r15019 r15025  
    3737t/12_dsfilesetls.t
    3838t/13_dsrootls.t
     39t/14_root.t
  • trunk/DataStore/lib/DataStore/Product/Parser.pm

    r7951 r15025  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: Parser.pm,v 1.1 2006-07-22 01:17:34 smalle Exp $
     5# $Id: Parser.pm,v 1.2 2007-09-26 00:13:29 jhoblitt Exp $
    66
    77package DataStore::Product::Parser;
     
    3434
    3535    my $parser = DataStore::Product::Parser->new(
    36         base_uri => 'http://example.org/',
     36        base_uri => 'http://example.org/index.txt',
    3737    );
    3838
     
    6363
    6464    my $parser = DataStore::Product::Parser->new(
    65         base_uri => 'http://example.org/',
     65        base_uri => 'http://example.org/index.txt',
    6666    );
    6767
     
    9191                    'is valid http uri' =>
    9292                        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
    9496                },
    95                 default =>  'http://example.org/',
     97                default =>  'http://example.org/index.txt',
    9698            },
    9799        },
    98100    );
    99101
    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;
    101106
    102107    return $self;
     
    188193            type          => $type,
    189194            desc          => $desc,
    190             uri           => $self->base_uri . $product . '/',
     195            uri           => $self->base_uri . $product . '/index.txt',
    191196        });
    192197    } continue {
  • trunk/DataStore/lib/DataStore/Root.pm

    r8144 r15025  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: Root.pm,v 1.3 2006-08-04 22:18:04 smalle Exp $
     5# $Id: Root.pm,v 1.4 2007-09-26 00:13:29 jhoblitt Exp $
    66
    77package DataStore::Root;
     
    1616
    1717use Carp qw( carp );
    18 use DataStore::FileSet::Parser;
     18use DataStore::Product::Parser;
    1919use DataStore::Record;
    2020use DataStore::Response;
     
    9494                type        => SCALAR,
    9595                callbacks   => {
    96                     'is valid uri dirname'   => sub { $_[0] =~ m|/$| },
     96                    'uri ends with /index.txt' =>
     97                        sub { $_[0] =~ m|/index.txt$| },
    9798                }
    9899            },
Note: See TracChangeset for help on using the changeset viewer.