line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
37
|
|
|
37
|
|
16346
|
use strict; |
|
37
|
|
|
|
|
109
|
|
|
37
|
|
|
|
|
1167
|
|
3
|
37
|
|
|
37
|
|
313
|
use warnings; |
|
37
|
|
|
|
|
99
|
|
|
37
|
|
|
|
|
1764
|
|
4
|
|
|
|
|
|
|
|
5
|
37
|
|
|
37
|
|
249
|
use WWW::Shopify::Liquid::Tag; |
|
37
|
|
|
|
|
90
|
|
|
37
|
|
|
|
|
1279
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Tag::Paginate; |
8
|
37
|
|
|
37
|
|
229
|
use base 'WWW::Shopify::Liquid::Tag::Enclosing'; |
|
37
|
|
|
|
|
97
|
|
|
37
|
|
|
|
|
13081
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub process { |
11
|
0
|
|
|
0
|
0
|
|
my ($self, $hash, $action, $pipeline) = @_; |
12
|
0
|
0
|
|
|
|
|
return '' unless int(@{$self->{arguments}}) > 0; |
|
0
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $result = $self->{arguments}->[0]->$action($pipeline, $hash); |
14
|
0
|
|
|
|
|
|
my ($string, $argument); |
15
|
0
|
0
|
0
|
|
|
|
if ($result && ref($result) && $result->isa('WWW::Shopify::Liquid::Operator::By')) { |
|
|
|
0
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $reference = $pipeline->variable_reference($hash, $result->{operands}->[0], 1); |
17
|
0
|
|
|
|
|
|
my $amount = $result->{operands}->[1]->$action($pipeline, $hash); |
18
|
0
|
|
|
|
|
|
$$reference = $self->paginate($hash, $reference, $amount); |
19
|
0
|
|
|
|
|
|
my $result = $self->{contents}->$action($pipeline, $hash); |
20
|
0
|
|
|
|
|
|
return $result; |
21
|
|
|
|
|
|
|
} else { |
22
|
0
|
|
|
|
|
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub paginate { |
27
|
0
|
|
|
0
|
0
|
|
my ($self, $hash, $variable_reference, $amount) = @_; |
28
|
0
|
|
|
|
|
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |