line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
21
|
|
|
21
|
|
9973
|
use strict; |
|
21
|
|
|
|
|
38
|
|
|
21
|
|
|
|
|
711
|
|
3
|
21
|
|
|
21
|
|
100
|
use warnings; |
|
21
|
|
|
|
|
35
|
|
|
21
|
|
|
|
|
729
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# TODO: Write this. |
6
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Filter::ProductImgUrl; |
7
|
21
|
|
|
21
|
|
91
|
use base 'WWW::Shopify::Liquid::Filter'; |
|
21
|
|
|
|
|
32
|
|
|
21
|
|
|
|
|
4168
|
|
8
|
1
|
|
|
1
|
0
|
9
|
sub min_arguments { return 1; } |
9
|
2
|
|
|
2
|
0
|
12
|
sub max_arguments { return 1; } |
10
|
|
|
|
|
|
|
sub operate { |
11
|
0
|
|
|
0
|
0
|
|
my ($self, $hash, $operand, @arguments) = @_; |
12
|
0
|
|
|
|
|
|
my $size = $arguments[0]; |
13
|
0
|
|
|
|
|
|
$operand =~ s/(\.(jpg|png|jpeg|gif))/_$size$1/i; |
14
|
0
|
|
|
|
|
|
return $operand; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |