diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index d0a934ed1..b9cf47853 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -28,8 +28,8 @@ use WebGUI::User; use Moose; use Plack::Request; -has root => ( is => 'ro', isa => 'Str', required => 1 ); # e.g. /data/WebGUI -has site => ( is => 'ro', isa => 'Str', required => 1 ); # e.g. dev.localhost.localdomain.conf +has root => ( is => 'ro', isa => 'Str', default => '/data/WebGUI' ); +has site => ( is => 'ro', isa => 'Str', default => 'dev.localhost.localdomain.conf' ); has session => ( is => 'rw', isa => 'WebGUI::Session' ); has config => ( is => 'rw', isa => 'WebGUI::Config' ); @@ -58,11 +58,11 @@ around BUILDARGS => sub { my $class = shift; # Make constructor work as: - # WebGUI->new( $root, $site ) + # WebGUI->new( $site ) # In addition to the more verbose: # WebGUI->new( root => $root, site => $site ) - if (@_ eq 2) { - return $class->$orig(root => $_[0], site => $_[1] ); + if (@_ eq 1) { + return $class->$orig(site => $_[0] ); } else { return $class->$orig(@_); } @@ -167,4 +167,7 @@ sub dispatch { return $session->response->finalize; } -1; +no Moose; +__PACKAGE__->meta->make_immutable; + +1; \ No newline at end of file