| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package JSON::Karabiner::Manipulator::Conditions ; |
|
2
|
|
|
|
|
|
|
$JSON::Karabiner::Manipulator::Conditions::VERSION = '0.016'; |
|
3
|
2
|
|
|
2
|
|
1130
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
59
|
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
59
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use JSON; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
10
|
|
|
6
|
2
|
|
|
2
|
|
186
|
use Carp; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
208
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
|
10
|
7
|
|
|
7
|
0
|
19
|
my $class = shift; |
|
11
|
7
|
|
|
|
|
13
|
my $type = shift; |
|
12
|
|
|
|
|
|
|
|
|
13
|
7
|
|
|
|
|
36
|
my $self = { |
|
14
|
|
|
|
|
|
|
def_name => $type, |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
}; |
|
17
|
7
|
|
|
|
|
15
|
bless $self, $class; |
|
18
|
|
|
|
|
|
|
{ |
|
19
|
2
|
|
|
2
|
|
23
|
no warnings 'once'; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
377
|
|
|
|
7
|
|
|
|
|
15
|
|
|
20
|
7
|
|
|
|
|
12
|
$main::current_condition = $self; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
7
|
|
|
|
|
18
|
return $self; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub TO_JSON { |
|
26
|
2
|
|
|
2
|
0
|
6
|
my $obj = shift; |
|
27
|
2
|
|
|
|
|
4
|
my $name = $obj->{def_name}; |
|
28
|
2
|
|
|
|
|
3
|
my $value = $obj->{data}; |
|
29
|
2
|
|
|
|
|
4
|
my @data_hash = @{$obj->{data}}; |
|
|
2
|
|
|
|
|
5
|
|
|
30
|
2
|
|
|
|
|
3
|
my %super_hash = (); |
|
31
|
2
|
|
|
|
|
4
|
foreach my $hash (@data_hash) { |
|
32
|
4
|
|
|
|
|
9
|
my %hash = %$hash; |
|
33
|
4
|
|
|
|
|
13
|
%super_hash = (%super_hash, %hash); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
2
|
|
|
|
|
10
|
%super_hash = (%super_hash, type => $name); |
|
36
|
2
|
|
|
|
|
28
|
return { %super_hash }; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# ABSTRACT: turns baubles into trinkets |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |