]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/Text/XslateBridge.pm
switch to compatibility level 12
[debbugs.git] / Debbugs / Text / XslateBridge.pm
1 # This module is part of debbugs, and is released
2 # under the terms of the GPL version 2, or any later
3 # version at your option.
4 # See the file README and COPYING for more information.
5 #
6 # Copyright 2018 by Don Armstrong <don@donarmstrong.com>.
7
8 package Debbugs::Text::XslateBridge;
9
10 use warnings;
11 use strict;
12
13 use base qw(Text::Xslate::Bridge);
14
15 =head1 NAME
16
17 Debbugs::Text::XslateBridge -- bridge for Xslate to add in useful functions
18
19 =head1 DESCRIPTION
20
21 This module provides bridge functionality to load functions into
22 Text::Xslate. It's loosely modeled after
23 Text::Xslate::Bridge::TT2Like, but with fewer functions.
24
25 =head1 BUGS
26
27 None known.
28
29 =cut
30
31
32 use vars qw($VERSION);
33
34 BEGIN {
35      $VERSION = 1.00;
36 }
37
38 use Text::Xslate;
39
40 __PACKAGE__->
41     bridge(scalar => {length => \&__length,
42                      },
43            function => {length => \&__length,}
44           );
45
46 sub __length {
47     length $_[0];
48 }
49
50
51 1;