Add note about new method in Upgrading.pod
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Server.pm
index 1848e4a..6c859b9 100644 (file)
@@ -2,7 +2,7 @@ package Catalyst::Script::Server;
 use Moose;
 use Catalyst::Utils;
 use Class::Load qw(try_load_class load_class);
-use namespace::autoclean;
+use namespace::clean -except => [ 'meta' ];
 
 with 'Catalyst::ScriptRole';
 
@@ -37,6 +37,7 @@ has port => (
     cmd_aliases   => 'p',
     isa           => 'Int',
     is            => 'ro',
+    lazy          => 1,
     default       => sub {
         Catalyst::Utils::env_value(shift->application_name, 'port') || 3000
     },
@@ -77,7 +78,7 @@ sub BUILD {
         my ($success, $error) = try_load_class("MooseX::Daemonize::Core");
         warn("MooseX::Daemonize is needed for the --background option: $error\n"),
             exit 1 if not $success;
-        my ($success, $error) = try_load_class("POSIX");
+        ($success, $error) = try_load_class("POSIX");
         warn("$error\n"), exit 1 if not $success;
         MooseX::Daemonize::Core->meta->apply($self);
         POSIX::close($_) foreach (0..2);
@@ -107,6 +108,7 @@ has restart => (
     cmd_aliases   => 'r',
     isa           => 'Bool',
     is            => 'ro',
+    lazy          => 1,
     default       => sub {
         Catalyst::Utils::env_value(shift->application_name, 'reload') || 0;
     },