[Rt-commit] r2571 - in experiments/Bamboo: . ex/trivial/bin ex/trivial/html ex/trivial/lib ex/trivial/lib/Bamboo

jesse at bestpractical.com jesse at bestpractical.com
Sun Apr 3 09:24:08 EDT 2005


Author: jesse
Date: Sun Apr  3 09:24:08 2005
New Revision: 2571

Added:
   experiments/Bamboo/ex/trivial/lib/Bamboo.pm
   experiments/Bamboo/ex/trivial/lib/Bamboo/Server.pm
   experiments/Bamboo/ex/trivial/lib/Bamboo/View.pm
Modified:
   experiments/Bamboo/   (props changed)
   experiments/Bamboo/ex/trivial/bin/server
   experiments/Bamboo/ex/trivial/html/autohandler
Log:
 r11693 at hualien:  jesse | 2005-04-03 21:23:30 +0800
 * More refactoing


Modified: experiments/Bamboo/ex/trivial/bin/server
==============================================================================
--- experiments/Bamboo/ex/trivial/bin/server	(original)
+++ experiments/Bamboo/ex/trivial/bin/server	Sun Apr  3 09:24:08 2005
@@ -1,15 +1,14 @@
+#!/usr/bin/perl
 
-my $s=Eagle::Server->new(13432);
-$s->run();
+use warnings;
+use strict;
 
-package Eagle::Server;
-use base qw/HTTP::Server::Simple::Mason/;
-use File::Spec;
-use FindBin;
-use lib $FindBin::Bin."/../lib";
+BEGIN {
+    use FindBin;
+    use lib $FindBin::Bin."/../lib"
+};
 
-sub mason_config {
-    return ( comp_root => "$FindBin::Bin/../html");
-}
+use Bamboo;
+my $s = Bamboo::Server->new(8888);
 
-1;
+$s->run();

Modified: experiments/Bamboo/ex/trivial/html/autohandler
==============================================================================
--- experiments/Bamboo/ex/trivial/html/autohandler	(original)
+++ experiments/Bamboo/ex/trivial/html/autohandler	Sun Apr  3 09:24:08 2005
@@ -1,36 +1,5 @@
 <%init>
-use Bamboo::Controller;
 use Counter;
-
-# Model
-{
-    package Bamboo;
-    our $VERSION = '0.01';
-
-    package Bamboo::View;
-
-    sub new {
-        my $class = shift;
-        my %attrs = @_;
-        return bless(\%attrs, $class);
-    }
-
-    sub it      { $_[0]{it} }
-    sub label   { $_[0]{label} }
-    sub class   { ref $_[0]{it} }
-
-    sub get {
-        my ($self, $attr) = @_;
-        $self->it->{$attr};
-    }
-
-    sub call {
-        my ($self, $method) = @_;
-        $::seq++;
-        join('-' => 'Bamboo', Bamboo->VERSION, $::seq, "call", $self->class, $self->label, $method); 
-    }
-}
-
 # Bamboo::Controller
 Bamboo::Controller->run( $m->fetch_next->attr('Operations') );
 Bamboo::Controller->run( Bamboo::Controller->extract(\%ARGS) );

Added: experiments/Bamboo/ex/trivial/lib/Bamboo.pm
==============================================================================
--- (empty file)
+++ experiments/Bamboo/ex/trivial/lib/Bamboo.pm	Sun Apr  3 09:24:08 2005
@@ -0,0 +1,14 @@
+use warnings;
+use strict;
+
+package Bamboo;
+use Bamboo::View;
+use Bamboo::Controller;
+use Bamboo::Server;
+
+
+use vars qw/$VERSION/;
+$Bamboo::VERSION=0.01;
+
+
+1;

Added: experiments/Bamboo/ex/trivial/lib/Bamboo/Server.pm
==============================================================================
--- (empty file)
+++ experiments/Bamboo/ex/trivial/lib/Bamboo/Server.pm	Sun Apr  3 09:24:08 2005
@@ -0,0 +1,10 @@
+package Bamboo::Server;
+use base qw/HTTP::Server::Simple::Mason/;
+use File::Spec;
+use FindBin;
+
+sub mason_config {
+    return ( comp_root => "$FindBin::Bin/../html");
+}
+
+1;

Added: experiments/Bamboo/ex/trivial/lib/Bamboo/View.pm
==============================================================================
--- (empty file)
+++ experiments/Bamboo/ex/trivial/lib/Bamboo/View.pm	Sun Apr  3 09:24:08 2005
@@ -0,0 +1,24 @@
+    package Bamboo::View;
+
+    sub new {
+        my $class = shift;
+        my %attrs = @_;
+        return bless(\%attrs, $class);
+    }
+
+    sub it      { $_[0]{it} }
+    sub label   { $_[0]{label} }
+    sub class   { ref $_[0]{it} }
+
+    sub get {
+        my ($self, $attr) = @_;
+        $self->it->{$attr};
+    }
+
+    sub call {
+        my ($self, $method) = @_;
+        $::seq++;
+        join('-' => 'Bamboo', Bamboo->VERSION, $::seq, "call", $self->class, $self->label, $method); 
+    }
+
+1;


More information about the Rt-commit mailing list