line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::IPerl::Display::Role::Source; |
2
|
|
|
|
|
|
|
$Devel::IPerl::Display::Role::Source::VERSION = '0.007'; |
3
|
2
|
|
|
2
|
|
1116
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use Moo::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has [ qw[bytestream filename uri] ] => ( is => 'rw' ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub BUILDARGS { |
11
|
9
|
|
|
9
|
0
|
10460
|
my ( $class, @args ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# if first arg is data that needs to be determined |
14
|
9
|
100
|
|
|
|
38
|
if( @args % 2 == 1 ) { |
15
|
8
|
|
|
|
|
15
|
my $data = shift @args; |
16
|
8
|
100
|
|
|
|
31
|
if( $data =~ /^http[s]?:/ ) { |
|
|
100
|
|
|
|
|
|
17
|
2
|
|
|
|
|
9
|
unshift @args, uri => $data; |
18
|
2
|
|
|
2
|
|
1116
|
} elsif( eval { no warnings qw(newline); -f $data } ) { |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
165
|
|
|
6
|
|
|
|
|
196
|
|
19
|
|
|
|
|
|
|
# using no warnings/eval to avoid warning about newline in filename |
20
|
4
|
|
|
|
|
154
|
unshift @args, filename => $data; |
21
|
|
|
|
|
|
|
} else { |
22
|
2
|
|
|
|
|
10
|
unshift @args, bytestream => $data; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
9
|
|
|
|
|
169
|
return { @args }; |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=pod |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=encoding UTF-8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Devel::IPerl::Display::Role::Source |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 VERSION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
version 0.007 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHOR |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Zakariyya Mughal <zmughal@cpan.org> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Zakariyya Mughal. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
54
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |