line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::uuid; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
85714
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
160015
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
695
|
use Data::UUID::MT; |
|
1
|
|
|
|
|
58717
|
|
|
1
|
|
|
|
|
39
|
|
7
|
1
|
|
|
1
|
|
9
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
1
|
|
|
1
|
|
748
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
850
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit { |
15
|
3
|
|
|
3
|
0
|
16992
|
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
|
|
270
|
my $var = shift; |
23
|
3
|
|
|
|
|
9
|
"${var} = Data::UUID::MT->new(version => 4)->create_string;"; |
24
|
|
|
|
|
|
|
} |
25
|
3
|
|
|
|
|
127
|
); |
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; |