--- trunk/lib/Frey/Server.pm 2008/11/29 22:02:08 627 +++ trunk/lib/Frey/Server.pm 2008/11/30 23:49:32 653 @@ -36,8 +36,8 @@ sub print { my $self = shift; - warn "# print ",dump( @_ ); - $self->{print}->( @_ ); + warn "# print ", join(' ', map { length $_ } @_ ); + $self->{_print}->( @_ ); } sub request { @@ -45,13 +45,14 @@ if ( my $ref = ref($url) ) { die "url not URI but ", dump( $url ) unless $ref =~ m{^URI}; + } else { $url = URI->new($url); } my $path = $url->path; -# eval { - { + eval { +# { if ( $path =~ m{/reload(.*)} ) { @@ -61,9 +62,9 @@ if ( system($cmd) == 0 ) { my $server = Frey::Server->new; $self->load_config; - Module::Reload->check; +# Module::Reload->check; warn "# reload done"; - $self->print( refresh( $1, 1 ) ); + $self->print( refresh( $1, 0 ) ); return; } else { warn "ERROR: $?"; @@ -85,7 +86,6 @@ return $class; } - my $f; # shared run params @@ -113,18 +113,17 @@ my $class = rest2class $1; warn "# run $path -> $class $2"; $run->{format} = $3 if $3; - $params->{request_url} = $url, $run->{$_} = $params->{$_} foreach keys %$params; - $f = Frey::Run->new( class => $class, params => $run, run => $2, request_url => $url ); + $f = Frey::Run->new( class => $class, params => $run, run => $2 ); } elsif ( $path =~ m{/([^/]+)/?$} ) { my $class = rest2class $1; warn "# introspect $class"; $run->{class} ||= $class; - $f = Frey::Run->new( class => 'Frey::Introspect', params => $run, request_url => $url ); + $f = Frey::Run->new( class => 'Frey::Introspect', params => $run ); } else { - $f = Frey::Run->new( class => 'Frey::ClassBrowser', params => $run, request_url => $url ); + $f = Frey::Run->new( class => 'Frey::ClassBrowser', params => $run ); } if ( $f ) { @@ -155,7 +154,7 @@ sub refresh { my ( $url, $time ) = @_; $url ||= '/'; - $time ||= 1; + $time ||= 0; warn "# refresh $url"; qq|