Permalink
Browse files

first draft for a load_app function in DSL

  • Loading branch information...
1 parent 2fb3b34 commit 3c3988eea005313338006ef9a62bf204c0bde3c8 Alexis Sukrieh committed Dec 26, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Dancer/Core/DSL.pm
View
@@ -115,6 +115,21 @@ sub hook {
$self->app->add_hook(Dancer::Core::Hook->new(name => $name, code => $code));
}
+sub load_app {
+ my ($self, $app_name, %options) = @_;
+
+ # set the application
+ eval "use $app_name";
+ croak "Unable to load application \"$app_name\" : $@" if $@;
+
+ croak "$app_name is not a Dancer application"
+ if ! $app_name->can('dancer_app');
+ my $app = $app->dancer_app;
+
+# FIXME not working yet
+}
+
+
sub prefix {
my $app = shift->app;
@_ == 1

0 comments on commit 3c3988e

Please sign in to comment.