--- trunk/lib/Frey/Server.pm 2008/11/18 00:55:23 392 +++ trunk/lib/Frey/Server.pm 2008/11/18 12:02:57 407 @@ -12,6 +12,7 @@ #use Carp::REPL; ## XXX it would be nice, but it breaks error reporting too much use Frey::ClassLoader; use Frey::Run; +use Frey::Editor; my @messages; # Global (shared) list of messages my $got_message; # Flag to indicate that there is a new message to display @@ -81,6 +82,7 @@ my $f; my $run_regexp = join('|', Frey::Run->runnable ); + my $editor = Frey::Editor->new; if ( $path =~ m{/Frey[:-]+ObjectBrowser} @@ -92,15 +94,9 @@ ) { $f = Frey::ObjectDesigner->new( fey_class => $params{class} ); $f->request( $req ); - } elsif ( - $path =~ m{/editor(.+?)\+(\d+)} - ) { - my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi'; - # FIXME SECURITY path verification for $1 - my $cmd = "$editor +$2 $1"; - warn "# $path -> system $cmd"; - $req->print( $cmd ); - system( $cmd ); + } elsif ( $path =~ $editor->url_regex ) { + $req->print( $editor->command( $path ) ); + system( $editor->command( $path ) ); return; } elsif ( $path =~ m{/([^/]+)/($run_regexp)}