Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 657880fc85
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (26 sloc) 0.739 kB
package Angelos::Dispatcher::Routes::Builder;
use Angelos::Class;
use Angelos::Config;
use HTTP::Router;
use Angelos::Exceptions;
with 'Angelos::Class::Configurable';
sub build_from_config {
my $self = shift;
my $conf_path = $self->config->routes_config_path;
Angelos::Exception->throw(
message => "routes.pl doesn't exit: $conf_path" )
unless -f $conf_path;
$self->build($conf_path);
}
sub build {
my ( $self, $conf ) = @_;
my $content = $conf->slurp;
my $router = eval $content;
if ( my $e = $@ ) {
Angelos::Exception->throw(
message => "Can't load routes.pl: $conf. error: $e" );
}
my @routeset = $router->routeset;
\@routeset;
}
__END_OF_CLASS__
Jump to Line
Something went wrong with that request. Please try again.