lib/WWW/Shopify/Liquid/Dialect/Shopify/Filter/Handleize.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 2 SCAR 12.0
CC
2
Cov
0%
operate
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4  
5 package WWW::Shopify::Liquid::Dialect::Shopify::Filter::Handleize;
6 use base 'WWW::Shopify::Liquid::Filter';
7 use Text::Unaccent::PurePerl;
8  
9  
10 sub operate {
11 my $str = $_[2]; $str = '' unless defined $str;
12 $str =~ s/^\s+//;
13 $str =~ s/\s+$//;
14 $str =~ s/\s+/-/g;
15 $str =~ s/[^\w-]+//g;
16 return lc(unac_string($str));
17 }
18  
19 1;