line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::uuid; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
84118
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
156367
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
732
|
use Data::UUID::MT; |
|
1
|
|
|
|
|
58173
|
|
|
1
|
|
|
|
|
35
|
|
7
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
1
|
|
|
1
|
|
705
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
799
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit { |
15
|
3
|
|
|
3
|
0
|
16849
|
my ($self, $fixer) = @_; |
16
|
3
|
|
|
|
|
14
|
my $path = $fixer->split_path($self->path); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$fixer->emit_create_path( |
19
|
|
|
|
|
|
|
$fixer->var, |
20
|
|
|
|
|
|
|
$path, |
21
|
|
|
|
|
|
|
sub { |
22
|
3
|
|
|
3
|
|
215
|
my $var = shift; |
23
|
3
|
|
|
|
|
9
|
"${var} = Data::UUID::MT->new(version => 4)->create_string;"; |
24
|
|
|
|
|
|
|
} |
25
|
3
|
|
|
|
|
123
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Catmandu::Fix::uuid - create a Globally/Universally Unique Identifier |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
uuid(my.field) # my => {field => '4162F712-1DD2-11B2-B17E-C09EFE1DC403' } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SEE ALSO |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
L<Catmandu::Fix> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |