[Jifty-commit] jifty branch, plack-rebased, updated. 9610bcddfd00cdca109ead0c952c98324848f68f
Jifty commits
jifty-commit at lists.jifty.org
Sat Feb 6 09:48:51 EST 2010
The branch, plack-rebased has been updated
via 9610bcddfd00cdca109ead0c952c98324848f68f (commit)
from ace3cff19386702af03591d50d62947de0277bfd (commit)
Summary of changes:
Changelog | 18 ++++++++++++++++++
Makefile.PL | 1 +
lib/Jifty/Handler.pm | 13 +++++++++++++
t/TestApp/lib/TestApp/View.pm | 4 ++++
t/TestApp/t/99deprecation.t | 16 ++++++++++++++++
5 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 t/TestApp/t/99deprecation.t
- Log -----------------------------------------------------------------
commit 9610bcddfd00cdca109ead0c952c98324848f68f
Author: Chia-liang Kao <clkao at clkao.org>
Date: Sat Feb 6 22:46:31 2010 +0800
Document and test STDOUT printing deprecation.
diff --git a/Changelog b/Changelog
index be94f5a..03daddd 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,22 @@
-----------------------------------
+Jifty 1.??? -
+-----------------------------------
+
+INCOMPATABILITIES
+==========================
+ Jifty is ported to PSGI.
+ * The following methods are removed:
+ - Jifty->handler->apache
+ - Jifty->handler->cgi
+
+ Most methods for ->apache are provided by the Compat plugin, which
+ is automatically loaded for existing jifty apps. Use corresponding
+ header methods of Jifty->web->request and Jifty->web->response.
+
+ * Printing to STDOUT deprecated. Use outs, outs_raw, or
+ Jifty->web->response->body() instead.
+
+-----------------------------------
Jifty 0.91117 - November 17th, 2009
-----------------------------------
diff --git a/Makefile.PL b/Makefile.PL
index efa4d13..264eb2c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -52,6 +52,7 @@ requires('HTTP::Server::Simple::Recorder');
requires('Hash::Merge');
requires('Hash::MultiValue', 0.05);
requires('Hook::LexWrap');
+requires('IO::Handle::Util');
requires('IPC::PubSub' => '0.23' );
requires('IPC::Run3');
requires('Jifty::DBI' => '0.60' ); # Jifty::DBI::Collection Jifty::DBI::Handle Jifty::DBI::Record::Cachable Jifty::DBI::SchemaGenerator
diff --git a/lib/Jifty/Handler.pm b/lib/Jifty/Handler.pm
index 377b07d..2d3b7bc 100644
--- a/lib/Jifty/Handler.pm
+++ b/lib/Jifty/Handler.pm
@@ -159,6 +159,19 @@ sub handle_request {
$self->call_trigger('before_request', $req);
+ # Simple ensure stdout is not writable in next major release
+ use IO::Handle::Util qw(io_prototype io_to_glob);
+ my $trapio= io_prototype
+ print => sub {
+ use Carp::Clan qw(^(Jifty::Handler|Carp::|IO::Handle::));
+ carp "printing to STDOUT is deprecated. Use outs, outs_raw or Jifty->web->response->body() instead";
+
+ my $self = shift;
+ Jifty->handler->buffer->out_method->(shift);
+ };
+
+ local *STDOUT = io_to_glob($trapio);
+
# this is scoped deeper because we want to make sure everything is cleaned
# up for the LeakDetector plugin. I tried putting the triggers in the
# method (Jifty::Server::handle_request) that calls this, but Jifty::Server
diff --git a/t/TestApp/lib/TestApp/View.pm b/t/TestApp/lib/TestApp/View.pm
index e4eb256..664dd0c 100644
--- a/t/TestApp/lib/TestApp/View.pm
+++ b/t/TestApp/lib/TestApp/View.pm
@@ -155,4 +155,8 @@ template 'otherplace' => page {
form { }
};
+template 'naughty' => sub {
+ print STDOUT "this is bad";
+};
+
1;
diff --git a/t/TestApp/t/99deprecation.t b/t/TestApp/t/99deprecation.t
new file mode 100644
index 0000000..2686453
--- /dev/null
+++ b/t/TestApp/t/99deprecation.t
@@ -0,0 +1,16 @@
+use warnings;
+use strict;
+
+BEGIN { $ENV{'JIFTY_CONFIG'} = 't/config-Cachable' }
+use Jifty::Test::Dist tests => 3;
+use Jifty::Test::WWW::Mechanize;
+
+my $server = Jifty::Test->make_server;
+my $URL = $server->started_ok;
+
+my $mech = Jifty::Test::WWW::Mechanize->new();
+my $request = HTTP::Request->new( GET => "$URL/naughty");
+my $response = $mech->request($request);
+is($response->content, 'this is bad');
+$mech->warnings_like(qr/deprecated/);
+
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list