package VCP::Source::null ; =head1 NAME VCP::Source::null - A null source, for testing purposes =head1 SYNOPSIS vcp null: =head1 DESCRIPTION Takes no options, delivers no data. =cut $VERSION = 1.0 ; use strict ; use Carp ; use VCP::Debug ":debug" ; use base qw( VCP::Source ); sub new { my VCP::Source::null $self = shift->SUPER::new; ## Parse the options my ( $spec, $options ) = @_ ; die "vcp: the null source takes no spec ('$1')\n" if defined $spec && $spec =~ m{\Anull:(.+)}i; $self->repo_id( "null" ); $self->parse_repo_spec( $spec ) if defined $spec; $self->parse_options( $options ); return $self ; } sub options_spec { return (); } sub handle_header { my VCP::Source::null $self = shift ; my ( $header ) = @_ ; $self->dest->handle_header( $header ); return ; } sub get_source_file { my VCP::Source::null $self = shift; require File::Spec; my ( $r ) = @_; die "vcp: can't get file from a null source: ", $r->as_string, "\n"; } =head1 SEE ALSO L, L. =head1 AUTHOR Barrie Slaymaker =head1 COPYRIGHT Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved. See L (C) for the terms of use. =cut 1