Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: fac02388fb
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (28 sloc) 0.792 kB
package Angelos::Dispatcher::Routes::Builder;
use Angelos::Class;
use HTTP::Router;
use Angelos::Exceptions;
use Angelos::Utils;
sub build_from_config {
my $self = shift;
my $conf_path = $self->_route_config;
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; ##no critic
if ( my $e = $@ ) {
Angelos::Exception->throw(
message => "Can't load routes.pl: $conf. error: $e" );
}
my @routeset = $router->routeset;
\@routeset;
}
sub _route_config {
Angelos::Utils::context->project_structure->routes_config_file_path;
}
__END_OF_CLASS__
Jump to Line
Something went wrong with that request. Please try again.