Net::Trac::Mechanize - Provides persistent credentials for the Trac instance


Net-Trac documentation Contained in the Net-Trac distribution.

Index


Code Index:

NAME

Top

Net::Trac::Mechanize - Provides persistent credentials for the Trac instance

DESCRIPTION

Top

This class subclasses WWW::Mechanize to provide persistent HTTP credentials when accessing a Trac instance.

ACCESSORS / MUTATORS

Top

trac_user

trac_password

METHODS

Top

get_basic_credentials

Returns the credentials that WWW::Mechanize expects.

LICENSE

Top

Copyright 2008-2009 Best Practical Solutions.

This package is licensed under the same terms as Perl 5.8.8.


Net-Trac documentation Contained in the Net-Trac distribution.
use strict;
use warnings;

package Net::Trac::Mechanize;

use Any::Moose;
extends 'WWW::Mechanize';

has trac_user     => ( isa => 'Str', is => 'rw' );
has trac_password => ( isa => 'Str', is => 'rw' );

sub get_basic_credentials {
    my $self = shift;
    return ( $self->trac_user => $self->trac_password );
}

# This is commented because it breaks the class, causing it to
# seemingly not follow HTTP redirects.
#__PACKAGE__->meta->make_immutable;
no Any::Moose;

1;