line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Convenient Shoehorn for Bubblegum |
2
|
|
|
|
|
|
|
package gum; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
2241
|
use 5.10.0; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
389
|
|
5
|
9
|
|
|
9
|
|
2805
|
use Import::Into; |
|
9
|
|
|
|
|
13481
|
|
|
9
|
|
|
|
|
1851
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.45'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
45
|
|
|
45
|
|
126
|
my $target = caller; |
11
|
45
|
|
|
|
|
74
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
45
|
|
|
|
|
136
|
my @flags = grep /^-\w+/, @_; |
14
|
45
|
|
|
|
|
135
|
my %flags = map +($_, 1), map substr($_, 1), @flags; |
15
|
|
|
|
|
|
|
|
16
|
45
|
100
|
|
|
|
235
|
if ($flags{class}) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
17
|
1
|
|
|
|
|
334
|
require 'Bubblegum/Class.pm'; |
18
|
1
|
|
|
|
|
7
|
'Bubblegum::Class'->import::into($target); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
elsif ($flags{role}) { |
21
|
1
|
|
|
|
|
341
|
require 'Bubblegum/Role.pm'; |
22
|
1
|
|
|
|
|
7
|
'Bubblegum::Role'->import::into($target); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
elsif ($flags{singleton}) { |
25
|
1
|
|
|
|
|
288
|
require 'Bubblegum/Singleton.pm'; |
26
|
1
|
|
|
|
|
9
|
'Bubblegum::Singleton'->import::into($target); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
42
|
|
|
|
|
1577
|
require 'Bubblegum.pm'; |
30
|
42
|
|
|
|
|
240
|
'Bubblegum'->import::into($target); |
31
|
|
|
|
|
|
|
} |
32
|
45
|
50
|
33
|
|
|
31454
|
if ($flags{proto} or $flags{prototype}) { |
33
|
0
|
|
|
|
|
0
|
require 'Bubblegum/Prototype.pm'; |
34
|
0
|
|
|
|
|
0
|
'Bubblegum::Prototype'->import::into($target); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
45
|
|
|
|
|
110
|
my @exports = (); |
38
|
45
|
100
|
|
|
|
143
|
push @exports, '-types' if $flags{types}; |
39
|
45
|
100
|
|
|
|
142
|
push @exports, '-typesof' if $flags{types}; |
40
|
45
|
100
|
|
|
|
175
|
push @exports, '-isas' if $flags{isas}; |
41
|
45
|
100
|
|
|
|
152
|
push @exports, '-nots' if $flags{isas}; |
42
|
|
|
|
|
|
|
|
43
|
45
|
100
|
|
|
|
6302
|
if (@exports) { |
44
|
2
|
|
|
|
|
44
|
require 'Bubblegum/Constraints.pm'; |
45
|
2
|
|
|
|
|
13
|
'Bubblegum::Constraints'->import::into($target, @exports); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |