File Coverage

blib/lib/WWW/Shopify/Liquid/Dialect/Shopify/Filter/Handleize.pm
Criterion Covered Total %
statement 12 19 63.1
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 27 59.2


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 1     1   6 use strict;
  1         3  
  1         21  
3 1     1   4 use warnings;
  1         2  
  1         26  
4              
5             package WWW::Shopify::Liquid::Dialect::Shopify::Filter::Handleize;
6 1     1   4 use base 'WWW::Shopify::Liquid::Filter';
  1         2  
  1         75  
7 1     1   1412 use Text::Unaccent::PurePerl;
  1         27524  
  1         322  
8              
9              
10             sub operate {
11 0 0   0 0   my $str = $_[2]; $str = '' unless defined $str;
  0            
12 0           $str =~ s/^\s+//;
13 0           $str =~ s/\s+$//;
14 0           $str =~ s/\s+/-/g;
15 0           $str =~ s/[^\w-]+//g;
16 0           return lc(unac_string($str));
17             }
18              
19             1;