[Jifty-commit] jifty branch, master, updated. c5d7e9a83c8e3e9305bf57c0ac3e51ccb94e2f77

Jifty commits jifty-commit at lists.jifty.org
Fri Apr 2 13:56:47 EDT 2010


The branch, master has been updated
       via  c5d7e9a83c8e3e9305bf57c0ac3e51ccb94e2f77 (commit)
      from  231120479cb803e10680ebfc95f62c9bd6edf12d (commit)

Summary of changes:
 Makefile.PL                |    1 -
 lib/Jifty/Plugin/Compat.pm |   16 ++++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit c5d7e9a83c8e3e9305bf57c0ac3e51ccb94e2f77
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Apr 2 13:54:58 2010 -0400

    Inline our one use of Hook::LexWrap

diff --git a/Makefile.PL b/Makefile.PL
index 409f2ed..2a86aef 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -52,7 +52,6 @@ requires('HTTP::Server::Simple' => '0.35');  # HTTP::Server::Simple::CGI
 requires('HTTP::Server::Simple::Recorder');
 requires('Hash::Merge', '0.12');
 requires('Hash::MultiValue', 0.05);
-requires('Hook::LexWrap');
 requires('IO::Handle::Util');
 requires('IPC::PubSub' => '0.23' );
 requires('IPC::Run3');
diff --git a/lib/Jifty/Plugin/Compat.pm b/lib/Jifty/Plugin/Compat.pm
index 78f8021..786f47e 100644
--- a/lib/Jifty/Plugin/Compat.pm
+++ b/lib/Jifty/Plugin/Compat.pm
@@ -3,7 +3,6 @@ use warnings;
 
 package Jifty::Plugin::Compat;
 use base 'Jifty::Plugin';
-use Hook::LexWrap ();
 use CGI::Emulate::PSGI ();
 
 =head1 NAME
@@ -38,11 +37,16 @@ TODO: this should also rebind STDIN/STDOUT in the per-request hook.
 };
 
 require Jifty::View::Mason::Handler;
-Hook::LexWrap::wrap 'Jifty::View::Mason::Handler::new',
-    post => sub { my $self = shift;
-                  $self->interp->compiler->add_allowed_globals('$r');
-                  $self->interp->set_global('$r', 'Jifty::Plugin::Compat::Apache');
-              };
+my $old_new = Jifty::View::Mason::Handler->can('new');
+no warnings 'redefine';
+*Jifty::View::Mason::Handler::new = sub {
+    my $self = $old_new->(@_);
+
+    $self->interp->compiler->add_allowed_globals('$r');
+    $self->interp->set_global('$r', 'Jifty::Plugin::Compat::Apache');
+
+    return $self;
+};
 
 sub wrap {
     my ($self, $app) = @_;

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list