[Catalyst-commits] r12064 - in
Catalyst-Runtime/5.80/branches/better_scripts:
lib/Catalyst/Script t/aggregate
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sun Nov 29 14:00:20 GMT 2009
Author: rafl
Date: 2009-11-29 14:00:19 +0000 (Sun, 29 Nov 2009)
New Revision: 12064
Modified:
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Server.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t
Log:
Make follow_symlinks more consistent with the other restarter args.
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Server.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Server.pm 2009-11-29 14:00:12 UTC (rev 12063)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Server.pm 2009-11-29 14:00:19 UTC (rev 12064)
@@ -117,23 +117,21 @@
is => 'ro',
default => 0,
documentation => 'Follow symbolic links',
+ predicate => '_has_follow_symlinks',
);
sub _restarter_args {
my $self = shift;
- my %args;
- $args{follow_symlinks} = $self->follow_symlinks
- if $self->follow_symlinks;
- $args{directories} = $self->restart_directory
- if $self->_has_restart_directory;
- $args{sleep_interval} = $self->restart_delay
- if $self->_has_restart_delay;
- if ($self->_has_restart_regex) {
- my $regex = $self->restart_regex;
- $args{filter} = qr/$regex/;
- }
- $args{start_sub} = sub { $self->_run_application };
- $args{argv} = $self->ARGV;
+
+ my %args = (
+ argv => $self->ARGV,
+ start_sub => sub { $self->_run_application },
+ ($self->_has_follow_symlinks ? (follow_symlinks => $self->follow_symlinks) : ()),
+ ($self->_has_restart_delay ? (sleep_interval => $self->restart_delay) : ()),
+ ($self->_has_restart_directory ? (directories => $self->restart_directory) : ()),
+ ($self->_has_restart_regex ? (filter => qr/${\$self->restart_regex}/) : ()),
+ );
+
return %args;
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t 2009-11-29 14:00:12 UTC (rev 12063)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t 2009-11-29 14:00:19 UTC (rev 12064)
@@ -110,6 +110,7 @@
sub restartopthash {
return {
+ follow_symlinks => 0,
@_,
};
}
More information about the Catalyst-commits
mailing list