line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Karabiner::Rule ; |
2
|
|
|
|
|
|
|
$JSON::Karabiner::Rule::VERSION = '0.016'; |
3
|
18
|
|
|
18
|
|
128
|
use strict; |
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
546
|
|
4
|
18
|
|
|
18
|
|
108
|
use warnings; |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
591
|
|
5
|
|
|
|
|
|
|
require JSON::Karabiner::Manipulator ; |
6
|
18
|
|
|
18
|
|
96
|
use Carp; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
4934
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
28
|
|
|
28
|
0
|
63
|
my $class = shift; |
10
|
28
|
|
|
|
|
49
|
my $desc = shift; |
11
|
28
|
50
|
|
|
|
67
|
croak 'JSON::Karabiner constructor requires a desc.' if !$desc; |
12
|
28
|
|
|
|
|
99
|
my $self = { |
13
|
|
|
|
|
|
|
description => $desc, |
14
|
|
|
|
|
|
|
manipulators => [] |
15
|
|
|
|
|
|
|
}; |
16
|
28
|
|
|
|
|
58
|
bless $self, $class; |
17
|
28
|
|
|
|
|
67
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _disable_validity_tests { |
21
|
44
|
|
|
44
|
|
79
|
my $s = shift; |
22
|
44
|
|
|
|
|
93
|
my $enable = shift; |
23
|
|
|
|
|
|
|
|
24
|
44
|
100
|
|
|
|
129
|
my $op = $enable ? 0 : 1; |
25
|
44
|
|
|
|
|
70
|
foreach my $manip (@{$s->{manipulators}}) { |
|
44
|
|
|
|
|
119
|
|
26
|
44
|
|
|
|
|
1845
|
$manip->{_disable_validity_tests} = $op; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _enable_validity_tests { |
31
|
22
|
|
|
22
|
|
61
|
my $s = shift; |
32
|
22
|
|
|
|
|
75
|
$s->_disable_validity_tests(1); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub add_manipulator { |
36
|
27
|
|
|
27
|
1
|
384
|
my $s = shift; |
37
|
|
|
|
|
|
|
|
38
|
27
|
|
|
|
|
147
|
my $manip = JSON::Karabiner::Manipulator->new_manipulator(); |
39
|
27
|
|
|
|
|
59
|
push @{$s->{manipulators}}, $manip; |
|
27
|
|
|
|
|
97
|
|
40
|
27
|
|
|
|
|
71
|
return $manip; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
28
|
|
|
28
|
0
|
99
|
sub TO_JSON { return { %{ shift() } }; } |
|
28
|
|
|
|
|
254
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ABSTRACT: turns baubles into trinkets |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |