Skip to content

Instantly share code, notes, and snippets.

use Plack::App::TemplateToolkit;
use Plack::App::File;
builder {
mount '/static' => Plack::App::File->new(
root => '/path/to/static/files',
)->to_app;
mount '/tt' => Plack::App::TemplateToolkit->new(
root => '/path/to/templates',
extension => '.tt',
abstract class Cell()
case class Space() extends Cell {
override def toString() = " "
}
case class X() extends Cell {
override def toString() = "X"
}
case class O() extends Cell {
override def toString() = "O"
}
(* vim: ts=2 sts=2 sw=2:
*)
#directory "+extlib"
#load "extLib.cma"
type mark = X | O
type space =
Empty
| Full of mark
# sort of a mini-global
my $c;
my $tx = Text::Xslate->new(
function => {
text_field => sub { $link_to->($c, @_) },
...
},
...,
);
# called as $render->($c, @other_render_args);
cpanm (App::cpanminus) 1.1005 on perl 5.012002 built for i686-linux-thread-multi
Work directory is /home/hdp/.cpanm/work/1297880895.3215
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
diff -ur old/Parser.pm new/Parser.pm
--- old/Parser.pm 2010-06-15 13:57:43.000000000 -0500
+++ new/Parser.pm 2011-03-01 13:44:02.000000000 -0600
@@ -260,6 +260,12 @@
unless $http and $http =~ /^HTTP\/(\d+)\.(\d+)$/i;
($major,$minor) = ($1,$2);
die 'HTTP requests not allowed' unless $self->{request};
+
+ # If the requested uri was a path instead of a full uri, we need to tell URI that we don't
+ # know the scheme, otherwise it will interpret paths that start with a
my $root = '.';
my @indexes = qw(index.html);
use strict;
use warnings;
use Plack::App::File;
use Plack::App::Cascade;
sub directory_indexes {
my ($root, @indexes) = @_;
my $file = Plack::App::File->new(root => $root)->to_app;
use strict;
use warnings;
use Plack::Builder;
use Plack::App::File;
sub slashify_if (&) {
my $code = shift;
return sub {
my $app = shift;
return sub {
diff --git a/lib/Starman/Server.pm b/lib/Starman/Server.pm
index c98af6f..a927e0d 100644
--- a/lib/Starman/Server.pm
+++ b/lib/Starman/Server.pm
@@ -21,6 +21,29 @@ my $null_io = do { open my $io, "<", \""; $io };
use Net::Server::SIG qw(register_sig);
+sub SSL_key_file {
+ my ($self, $host, $port, $proto) = @_;
diff --git a/lib/GraphViz.pm b/lib/GraphViz.pm
index 549c1fd..f69bb58 100644
--- a/lib/GraphViz.pm
+++ b/lib/GraphViz.pm
@@ -1124,17 +1124,12 @@ sub _as_debug {
$cluster->{label} = $name;
delete $cluster->{name};
}
- $attrs = _attributes($cluster);
+ $attrs = _attributes($cluster, for_cluster => 1);