[Jifty-commit] r570 - jifty/trunk/lib/Jifty
jifty/trunk/share/web/templates/_elements
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat Feb 11 17:00:33 EST 2006
Author: jesse
Date: Sat Feb 11 17:00:27 2006
New Revision: 570
Modified:
/ (props changed)
jifty/trunk/lib/Jifty/Config.pm
jifty/trunk/lib/Jifty/Dispatcher.pm
jifty/trunk/lib/Jifty/Handler.pm
jifty/trunk/lib/Jifty/Web.pm
jifty/trunk/share/web/templates/_elements/wrapper
jifty/trunk/t/TestApp/testapp
Log:
r23601 at truegrounds: jesse | 2006-02-11 16:59:14 -0500
* Refactored the dispatcher to use exceptions rather than LABELS: so that Devel::DProf doesn't fall over
* Added a new "DevelMode" flag, to toggle the peformance-killing development aids.
Modified: jifty/trunk/lib/Jifty/Config.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Config.pm (original)
+++ jifty/trunk/lib/Jifty/Config.pm Sat Feb 11 17:00:27 2006
@@ -211,6 +211,7 @@
return {
framework => {
AdminMode => 1,
+ DevelMode => 1,
ActionBasePath => $app_class . "::Action",
ApplicationClass => $app_class,
CurrentUserClass => $app_class . "::CurrentUser",
Modified: jifty/trunk/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Dispatcher.pm Sat Feb 11 17:00:27 2006
@@ -473,7 +473,7 @@
no warnings 'exiting';
sub next_rule { next RULE }
-sub last_rule { last HANDLER }
+sub last_rule { die "LAST RULE"; }
sub next_show { last HANDLE_WEB }
=head2 _do_under
@@ -643,8 +643,9 @@
my $err = $@;
# Handle parse errors
if ( $err and not UNIVERSAL::isa $err, 'HTML::Mason::Exception::Abort' ) {
+ # XXX TODO: get this into the browser somehow
warn "Mason error: $err";
- Jifty->web->redirect("/__jifty/error/mason_parse_error");
+ Jifty->web->redirect("/__jifty/error/mason_internal_error");
} elsif ($err) {
die $err;
}
@@ -702,10 +703,9 @@
$self->_handle_rules( [ $self->rules('RUN'), 'show' ] );
$self->_handle_rules( [ $self->rules('CLEANUP') ] );
}
- last_rule;
};
if ( my $err = $@ ) {
- warn ref($err) .$err;
+ warn ref($err) . " " ."'$err'" if ( $err !~ /^LAST RULE/);
}
}
Modified: jifty/trunk/lib/Jifty/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/Handler.pm Sat Feb 11 17:00:27 2006
@@ -53,7 +53,9 @@
=cut
sub mason_config {
- return (
+ my %config = (
+ static_source => 1,
+ use_object_files => 1,
allow_globals => [qw[$JiftyWeb], @{Jifty->config->framework('Web')->{'Globals'} || []}],
comp_root => [
[application => Jifty::Util->absolute_path( Jifty->config->framework('Web')->{'TemplateRoot'} )],
@@ -61,6 +63,18 @@
],
%{ Jifty->config->framework('Web')->{'MasonConfig'} },
);
+
+ # In developer mode, we want halos, refreshing and all that other good stuff.
+ if (Jifty->config->framework('DevelMode') ) {
+ push @{$config{'plugins'}}, 'Jifty::Mason::Halo';
+ $config{static_source} = 0;
+ $config{use_object_files} = 0;
+
+
+
+ }
+ return (%config);
+
}
=head2 cgi
@@ -96,7 +110,7 @@
@_
);
- Module::Refresh->refresh;
+ Module::Refresh->refresh if (Jifty->config->framework('DevelMode') );
$self->cgi($args{cgi});
$self->apache(HTML::Mason::FakeApache->new(cgi => $self->cgi));
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Sat Feb 11 17:00:27 2006
@@ -254,10 +254,13 @@
$self->log->debug("Validating action ".ref($action). " ".$action->moniker);
if ($action->validate) {
$self->log->debug("Running action.");
- $action->run
+ $action->run;
}
};
if ( my $err = $@ ) {
+ # poor man's exception propagation
+ # We need to get "LAST RULE" exceptions back up to the dispatcher
+ die $err if ($err =~ /^LAST RULE/);
$self->log->fatal($err);
}
Modified: jifty/trunk/share/web/templates/_elements/wrapper
==============================================================================
--- jifty/trunk/share/web/templates/_elements/wrapper (original)
+++ jifty/trunk/share/web/templates/_elements/wrapper Sat Feb 11 17:00:27 2006
@@ -19,7 +19,7 @@
document.write('</div>');
document.write('<div id="jifty-wait-message" style="display: none">Loading...</div>');
--></script>
-%# Jifty::Mason::Halo->render_component_tree();
+% Jifty::Mason::Halo->render_component_tree() if (Jifty->config->framework('DevelMode') );
</body>
</html>
%$m->notes('in_body' => 0);
Modified: jifty/trunk/t/TestApp/testapp
==============================================================================
Binary files. No diff available.
More information about the Jifty-commit
mailing list