--- trunk/lib/Frey/Server.pm 2008/11/05 20:18:33 314 +++ trunk/lib/Frey/Server.pm 2008/11/15 16:29:26 346 @@ -1,8 +1,9 @@ package Frey::Server; use Moose; - +extends 'Frey'; with 'Frey::Web'; +with 'Frey::Config'; use Continuity; #use Continuity::REPL; @@ -36,7 +37,7 @@ sub run { my ( $self, $port ) = @_; $server = Continuity->new( - port => $port || 16001, + port => $port || $self->config->{port} || 16001, path_session => 1, cookie_session => 'sid', callback => \&main, @@ -92,6 +93,15 @@ $f = Frey::ObjectDesigner->new( fey_class => $params{class} ); $f->request( $req ); } elsif ( + $path =~ m{/editor(.+?)\+(\d+)} + ) { + my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi'; + my $cmd = "$editor -R +$2 $1"; + warn "# $path -> system $cmd"; + $req->print( $cmd ); + system( $cmd ); + return; + } elsif ( $path =~ m{/([^/]+)/($run_regexp)} ) { my $class = rest2class $1;