[Catalyst-commits] r9461 - in trunk/examples/SmokeServer: . lib/SmokeServer/Controller

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Mar 8 22:55:34 GMT 2009


Author: t0m
Date: 2009-03-08 22:55:34 +0000 (Sun, 08 Mar 2009)
New Revision: 9461

Modified:
   trunk/examples/SmokeServer/Makefile.PL
   trunk/examples/SmokeServer/lib/SmokeServer/Controller/Feeds.pm
   trunk/examples/SmokeServer/lib/SmokeServer/Controller/Prefs.pm
   trunk/examples/SmokeServer/lib/SmokeServer/Controller/Smoke.pm
Log:
Remove BindLex

Modified: trunk/examples/SmokeServer/Makefile.PL
===================================================================
--- trunk/examples/SmokeServer/Makefile.PL	2009-03-08 22:45:05 UTC (rev 9460)
+++ trunk/examples/SmokeServer/Makefile.PL	2009-03-08 22:55:34 UTC (rev 9461)
@@ -25,7 +25,6 @@
 requires 'Catalyst::Model::DBIC::Schema' => '0';
 requires 'Catalyst::View::TT::FunctionGenerator' => '0';
 requires 'Catalyst::View::JSON' => '0';
-requires 'Catalyst::Controller::BindLex' => '0';
 
 test_requires 'Test::WWW::Mechanize::Catalyst';
 

Modified: trunk/examples/SmokeServer/lib/SmokeServer/Controller/Feeds.pm
===================================================================
--- trunk/examples/SmokeServer/lib/SmokeServer/Controller/Feeds.pm	2009-03-08 22:45:05 UTC (rev 9460)
+++ trunk/examples/SmokeServer/lib/SmokeServer/Controller/Feeds.pm	2009-03-08 22:55:34 UTC (rev 9461)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use base 'Catalyst::Controller::BindLex';
+use base 'Catalyst::Controller';
 
 sub end : Private {
     my ( $self, $c ) = @_;
@@ -22,7 +22,6 @@
 
     if ( my $prefix = $c->request->param("prefix") ) {
         if ( $c->request->param("parse_tags") ) {
-	
             $prefix = (Text::Tags::Parser->new->parse_tags( $prefix || "" ))[-1];
         }
 
@@ -38,19 +37,20 @@
     $filter{shallow} = 1 if exists $p->{shallow}; # overrides
     $filter{shallow} = 0 if exists $p->{deep};
 
-    my $feed_data : Stashed = $c->model("SmokeDB")->get_tags( %filter );
+    my $feed_data = $c->model("SmokeDB")->get_tags( %filter );
 
     if ( @prepend ) {
         for ( @$feed_data ) {
-	    $_ = Text::Tags::Parser->new->join_tags( @prepend, $_ );
-	}
+	        $_ = Text::Tags::Parser->new->join_tags( @prepend, $_ );
+	    }
     }
 
     if ( $c->request->param("pairs") ) {
     	for ( @$feed_data ) {
-	    $_ = [ $_ => $_ ];
-	}
+	        $_ = [ $_ => $_ ];
+	    }
     }
+    $c->stash->{feed_data} = $feed_data;
 }
 
 sub smokes : Local {

Modified: trunk/examples/SmokeServer/lib/SmokeServer/Controller/Prefs.pm
===================================================================
--- trunk/examples/SmokeServer/lib/SmokeServer/Controller/Prefs.pm	2009-03-08 22:45:05 UTC (rev 9460)
+++ trunk/examples/SmokeServer/lib/SmokeServer/Controller/Prefs.pm	2009-03-08 22:55:34 UTC (rev 9461)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use base qw/
-	Catalyst::Controller::BindLex
+	Catalyst::Controller
 /;
 
 use Text::Tags::Parser ();
@@ -70,7 +70,7 @@
 
 sub index : Private {
 	my ( $self, $c ) = @_;
-	my $template : Stashed = "prefs.tt";
+	$c->stash->{template} = "prefs.tt";
 }
 
 =head1 AUTHOR

Modified: trunk/examples/SmokeServer/lib/SmokeServer/Controller/Smoke.pm
===================================================================
--- trunk/examples/SmokeServer/lib/SmokeServer/Controller/Smoke.pm	2009-03-08 22:45:05 UTC (rev 9460)
+++ trunk/examples/SmokeServer/lib/SmokeServer/Controller/Smoke.pm	2009-03-08 22:55:34 UTC (rev 9461)
@@ -3,7 +3,6 @@
 use strict;
 use warnings;
 use base qw/
-    Catalyst::Controller::BindLex
     Catalyst::Controller
 /;
 
@@ -44,15 +43,15 @@
 
 sub index : Private {
     my ( $self, $c ) = @_;
-    my $template : Stashed = "list.tt";
+    my $c->stash->{template} = "list.tt";
     $c->forward("list");
 }
 
 sub list : Local {
     my ( $self, $c, @args ) = @_;
 
-    my $tag : Stashed = $c->request->param("tag");
-    $tag = shift @args if @args;
+    my $tag = $c->request->param("tag");
+    $c->stash->{tag} = $tag = shift @args if @args;
 
     my @group_tags : Stashed;
     if ( exists $c->req->params->{group_tags} ) {
@@ -68,22 +67,21 @@
     #$tag_string =~ tr/+/ /;
     #my $tags = Text::Folksonomies->new->parse( $tag_string );
 
-    my $smoke_rs : Stashed = $c->model("SmokeDB")->get_smokes(
+    my $smoke_rs = $c->stash->{smoke_rs} = $c->model("SmokeDB")->get_smokes(
         tag      => $tag,
     );
 
     my $grouper = SmokeDB::SmokeGrouper->new(@group_tags);
-    my $smokes : Stashed = $grouper->group( $smoke_rs );
+    my $smokes = $c->stash->{smokes} = $grouper->group( $smoke_rs );
 
     $c->forward("generate_tag_cloud", [ $smoke_rs, $tag ]);
 }
 
 sub generate_tag_cloud : Private {
     my ( $self, $c, $tag_filter ) = @_;
-    
-    my $smoke_rs : Stashed;
-    my $tag_rs = $smoke_rs->related_resultset("smoke_tags")->related_resultset("tag");
 
+    my $tag_rs = $c->stash->{smoke_rs}->related_resultset("smoke_tags")->related_resultset("tag");
+
     # filter ignored tags
     my $ignored_tags = $c->session->{ignored_tags_cloud};
     $tag_rs = $tag_rs->search({
@@ -100,7 +98,7 @@
         group_by => [ "tag.id" ],
     });
 
-    my $cloud : Stashed = HTML::TagCloud->new;
+    my $cloud = $c->stash->{cloud} = HTML::TagCloud->new;
 
     foreach my $tag ( $tags->all ) {
         my $name = $tag->name;




More information about the Catalyst-commits mailing list