X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lib%2FDebbugs%2FText%2FXslateBridge.pm;fp=lib%2FDebbugs%2FText%2FXslateBridge.pm;h=14652c22623177bc3399cc88ca78cf703943829d;hb=1e6633a3780f4fd53fc4303852e84d13cdad2dc6;hp=0000000000000000000000000000000000000000;hpb=466f7faff129a5699c7674f59900a92aa256175d;p=debbugs.git diff --git a/lib/Debbugs/Text/XslateBridge.pm b/lib/Debbugs/Text/XslateBridge.pm new file mode 100644 index 0000000..14652c2 --- /dev/null +++ b/lib/Debbugs/Text/XslateBridge.pm @@ -0,0 +1,51 @@ +# This module is part of debbugs, and is released +# under the terms of the GPL version 2, or any later +# version at your option. +# See the file README and COPYING for more information. +# +# Copyright 2018 by Don Armstrong . + +package Debbugs::Text::XslateBridge; + +use warnings; +use strict; + +use base qw(Text::Xslate::Bridge); + +=head1 NAME + +Debbugs::Text::XslateBridge -- bridge for Xslate to add in useful functions + +=head1 DESCRIPTION + +This module provides bridge functionality to load functions into +Text::Xslate. It's loosely modeled after +Text::Xslate::Bridge::TT2Like, but with fewer functions. + +=head1 BUGS + +None known. + +=cut + + +use vars qw($VERSION); + +BEGIN { + $VERSION = 1.00; +} + +use Text::Xslate; + +__PACKAGE__-> + bridge(scalar => {length => \&__length, + }, + function => {length => \&__length,} + ); + +sub __length { + length $_[0]; +} + + +1;