Net::Trac::Connection3pm
Connection to a remote trac server
Usage
use Net::Trac::Connection;my $trac = Net::Trac::Connection->new(url => 'http://trac.example.com',user => 'snoopy',password => 'doghouse');
Overview
This class represents a connection to a remote Trac instance. It is required by all other classes which need to talk to Trac.
Accessors
url
The url of the Trac instance used by this connection. Read-only after initialization.
user
password
Accessors / mutators
logged_in [BOOLEAN]
Gets/sets a boolean indicating whether or not the connection is logged in yet.
mech [MECH]
Gets/sets the Net::Trac::Mechanize (or subclassed) object for this connection to use. Unless you want to replace it with one of your own, the default will suffice.
Methods
new PARAMHASH
Creates a new Net::Trac::Connection given a paramhash with values for the keys "url", "user", and "password".
ensure_logged_in
Ensures this connection is logged in. Returns true on success, and undef on failure. Sets the "logged_in" flag.
Private methods
_fetch URL
Fetches the provided relative URL from the Trac server. Returns undef on an error (after "warn"ing) and the content ("$self-"mech->content>) on success.
_warn_on_error URL
Checks the last request for an error condition and warns about them if found. Returns with a TRUE value if errors occurred and a FALSE value otherwise for nicer conditionals.
_tsv_to_struct PARAMHASH
Takes a paramhash of the keys "data" Given TSV data this method will return a reference to an array.
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 4 times.