-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major update, in prep for merger with Bailador.
- Loading branch information
Timothy Totten
committed
Mar 20, 2013
1 parent
0773b0a
commit 6349658
Showing
9 changed files
with
163 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
blib | ||
Makefile | ||
*.pir | ||
*.pbc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
role Web::App::Ballet::Template | ||
{ | ||
method render ($template, *%named, *@positional) { ... } | ||
method set-path ($template-path) { ... } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class Web::App::Ballet::Template::HTML does Web::App::Ballet::Template | ||
{ | ||
use HTML::Template; | ||
|
||
has $!engine = HTML::Template; | ||
has $!path = './views'; | ||
|
||
method render ($template-name, *%named, *@positional) | ||
{ ## HTML::Template uses named parameters. | ||
my $template = $!path ~ $template-name; | ||
$!engine.from_file($template).with_params(%named).output; | ||
} | ||
|
||
method set-path ($template-path) | ||
{ | ||
$!path = $template-path; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class Web::App::Ballet::Template::Mojo does Web::App::Ballet::Template | ||
{ | ||
use Template::Mojo; | ||
|
||
has $!engine = Template::Mojo; | ||
has $!path = './views'; | ||
|
||
method render ($template-name, *%named, *@positional) | ||
{ ## Template::Mojo uses positional paramemters. | ||
my $template = slurp($!path ~ $template-name); | ||
$!engine.new($template).render(|@positional); | ||
} | ||
|
||
method set-path ($template-path) | ||
{ | ||
$!path = $template-path; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Web::App::Ballet::Template::TAL does Web::App::Ballet::Template | ||
{ | ||
use Flower::TAL; | ||
|
||
has $!engine = Flower::TAL.new; | ||
|
||
method render ($template, *%named, *@positional) | ||
{ ## Flower::TAL uses named parameters only. | ||
$!engine.process($template, |%named); | ||
} | ||
|
||
method set-path ($template-path) | ||
{ | ||
$!engine.provider.add-path($path); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Web::App::Ballet::Template::Template6 does Web::App::Ballet::Template | ||
{ | ||
use Template6; | ||
|
||
has $!engine = Template6.new; | ||
|
||
method render ($template, *%named, *@positional) | ||
{ ## Template6 uses named parameters only. | ||
$!engine.process($template, |%named); | ||
} | ||
|
||
method set-path ($template-path) | ||
{ | ||
$!engine.add-path($path); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters