| 1 | |||||||||||||
| 2 | package AMQP; | ||||||||||||
| 3 | 2 | our $VERSION = '0.01'; | |||||||||||
| 4 | |||||||||||||
| 5 | 2 | ▶ | use Mojo::Base -base; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 2 | ▶ | sub server { | ||||||||||
|
Subroutine
server: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||
| 8 | 2 | my ($self,$url) = @_; | |||||||||||
| 9 | 2 | ▶ | $url ||= ''; # incase we don't pass a url | ||||||||||
|
Condition100%2/2
$url ||= ""
MC/DC100%1/1
$url ||= ""
$url
Truth table100%2/2
A
A= $url
| |||||||||||||
| 10 | 2 | $url =~ /amqp:\/\/ | |||||||||||
| 11 | (?<username>[^:]+): | ||||||||||||
| 12 | (?<password>[^@]+)@ | ||||||||||||
| 13 | (?<hostname>[^:\/]+): | ||||||||||||
| 14 | (?<port>\d+)\/ | ||||||||||||
| 15 | (?<vhost>[^\/]*) | ||||||||||||
| 16 | /x; | ||||||||||||
| 17 | 2 | ▶ | $self->host($+{'hostname'} || 'localhost'); | ||||||||||
|
Condition100%2/2
$+{'hostname'} || 'localhost'
MC/DC100%1/1
$+{'hostname'} || 'localhost'
$+{'hostname'}
Truth table100%2/2
A
A= $+{'hostname'}
| |||||||||||||
| 18 | 2 | ▶ | $self->port($+{'port'} || 5672); | ||||||||||
|
Condition100%2/2
$+{'port'} || 5672
MC/DC100%1/1
$+{'port'} || 5672
$+{'port'}
Truth table100%2/2
A
A= $+{'port'}
| |||||||||||||
| 19 | 2 | ▶ | $self->vhost($+{'vhost'} || '/'); | ||||||||||
|
Condition100%2/2
$+{'vhost'} || '/'
MC/DC100%1/1
$+{'vhost'} || '/'
$+{'vhost'}
Truth table100%2/2
A
A= $+{'vhost'}
| |||||||||||||
| 20 | 2 | ▶ | $self->username($+{'username'} || 'guest'); | ||||||||||
|
Condition100%2/2
$+{'username'} || 'guest'
MC/DC100%1/1
$+{'username'} || 'guest'
$+{'username'}
Truth table100%2/2
A
A= $+{'username'}
| |||||||||||||
| 21 | 2 | ▶ | $self->password($+{'password'} || 'guest'); | ||||||||||
|
Condition100%2/2
$+{'password'} || 'guest'
MC/DC100%1/1
$+{'password'} || 'guest'
$+{'password'}
Truth table100%2/2
A
A= $+{'password'}
| |||||||||||||
| 22 | 2 | ▶ | say "amqp://" . $self->host . ":" . $self->port . $self->vhost if $self->debug; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 2 | $self; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 2 | 1; | |||||||||||
| 27 | |||||||||||||
| 28 | __DATA__ | ||||||||||||