Yet Anothor Girl, just web application framework.
Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
t
xt
.gitignore
.shipit
Changes
MANIFEST.SKIP
Makefile.PL
README.mkdn

README.mkdn

Rumi - yet another girl.

Rumi is lightweight web application framework for me.

Example

myapp.psgi

use lib "./lib";
use MyApp::Web;
use Plack::Builder;

my $web = MyApp::Web->new;
my $app = $web->to_app();

builder {
    enable "Plack::Middleware::Static",
      path => qr{^/(favicon\.ico|images/|js/|css/)},
      root => './htdocs/';
    enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' }
    "Plack::Middleware::ReverseProxy";
    enable "Plack::Middleware::AccessLog", format => "combined";
    $app;
};

MyApp/Web.pm

package MyApp::Web;
use strict;
use warnings;

use parent qw/Rumi::Web/;
use Text::Xslate;
sub install_view {
    my $view = Text::Xslate->new(
        path => ['./tmpl'],
        header => ['header.tt2'],
        footer => ['footer.tt2'],
        syntax => 'TTerse',
    );
    return { default => $view };
}

1;

MyApp/Web/Dispatcher.pm

package MyApp::Web::Dispatcher;
use strict;
use warnings;

use Rumi::Web::Dispatcher;
connect '/' => { controller => 'Root', action => 'index' };

1;

MyApp/Web/Controller/Root.pm

package MyApp::Web::Controller::Root;
use strict;
use warnings;

sub index {
    my ( $self, $c ) = @_;
    return 'index.tt2', {};
}

1;

Core required modules.

  • Plack::Request
  • Router::Simple
  • (Text::Xslate)

TODO

  • Writing tests
  • Setup script
  • Session

AUTHOR