--- trunk/lib/Frey/Server.pm 2008/11/09 09:58:13 341 +++ trunk/lib/Frey/Server.pm 2008/11/18 00:55:23 392 @@ -93,17 +93,27 @@ $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 ); + return; + } elsif ( $path =~ m{/([^/]+)/($run_regexp)} ) { my $class = rest2class $1; warn "# run $class $2\n"; - $f = Frey::Run->new( class => $class, params => \%params ); + $f = Frey::Run->new( class => $class, params => \%params, run => $2, request_url => $req->request->url ); } elsif ( $path =~ m{/([^/]+)/?$} ) { my $class = rest2class $1; warn "# introspect $class"; - $f = Frey::Run->new( class => 'Frey::Introspect', params => { class => $class } ); + $f = Frey::Run->new( class => 'Frey::Introspect', params => { class => $class }, request_url => $req->request->url ); } else { $f = Frey::Run->new( class => 'Frey::ClassBrowser' ); } @@ -121,7 +131,7 @@ if ( $@ ) { warn $@; $req->conn->send_error( 404 ); # FIXME this should probably be 500, but we can't ship page with it - $req->print( qq{
$@
} );
+		$req->print( qq{
$@
} );
 #		Carp::REPL::repl;
 
 	}