| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Graph::Easy::Marpa::Filer; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
579
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
33
|
|
|
4
|
1
|
|
|
1
|
|
941
|
use utf8; |
|
|
1
|
|
|
|
|
9
|
|
|
|
1
|
|
|
|
|
6
|
|
|
5
|
1
|
|
|
1
|
|
29
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
39
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings qw(FATAL utf8); # Fatalize encoding glitches. |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
44
|
|
|
7
|
1
|
|
|
1
|
|
894
|
use open qw(:std :utf8); # Undeclared streams in UTF-8. |
|
|
1
|
|
|
|
|
1284
|
|
|
|
1
|
|
|
|
|
5
|
|
|
8
|
1
|
|
|
1
|
|
1237
|
use charnames qw(:full :short); # Unneeded in v5.16. |
|
|
1
|
|
|
|
|
39840
|
|
|
|
1
|
|
|
|
|
6
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
241
|
use File::Basename; # For basename(). |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
118
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
973
|
use Moo; |
|
|
1
|
|
|
|
|
18099
|
|
|
|
1
|
|
|
|
|
10
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '2.01'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ------------------------------------------------ |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub get_files |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
1
|
|
|
1
|
1
|
58
|
my($self, $dir_name, $type) = @_; |
|
21
|
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
60
|
opendir(INX, $dir_name); |
|
23
|
1
|
|
|
|
|
84
|
my(@file) = sort grep{/$type$/} readdir INX; |
|
|
192
|
|
|
|
|
452
|
|
|
24
|
1
|
|
|
|
|
37
|
closedir INX; |
|
25
|
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
3
|
my(%file); |
|
27
|
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
5
|
for my $file_name (@file) |
|
29
|
|
|
|
|
|
|
{ |
|
30
|
75
|
|
|
|
|
1724
|
$file{basename($file_name, ".$type")} = $file_name; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
40
|
return %file; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} # End of get_files. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L - Some utils to simplify testing |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 Synopsis |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
See L. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
See t/tokens.t. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 Description |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Some utils to simplify testing. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
End-users do not need to call the methods in this module. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 Distributions |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This module is available as a Unix-style distro (*.tgz). |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
See L |
|
64
|
|
|
|
|
|
|
for help on unpacking and installing distros. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 Installation |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Install L as you would for any C module: |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Run: |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
cpanm Graph::Easy::Marpa |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
or run: |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sudo cpan Graph::Easy::Marpa |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
or unpack the distro, and then either: |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
perl Build.PL |
|
81
|
|
|
|
|
|
|
./Build |
|
82
|
|
|
|
|
|
|
./Build test |
|
83
|
|
|
|
|
|
|
sudo ./Build install |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
or: |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
perl Makefile.PL |
|
88
|
|
|
|
|
|
|
make (or dmake or nmake) |
|
89
|
|
|
|
|
|
|
make test |
|
90
|
|
|
|
|
|
|
make install |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 Constructor and Initialization |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 Calling new() |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
C is called as C<< my($obj) = Graph::Easy::Marpa::Filer -> new(k1 => v1, k2 => v2, ...) >>. |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
It returns a new object of type C. |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Key-value pairs accepted in the parameter list: |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=over 4 |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item o (none) |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=back |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 Methods |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 get_files($dir_name, $type) |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Returns a list of files from the given $dir_name, whose type (extension) matches $type. |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
See t/tokens.t. |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 Thanks |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Many thanks are due to the people who chose to make L Open Source. |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
And thanks to L, who wrote L, and kindly gave me co-maint of the module. |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 Version Numbers |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Version numbers < 1.00 represent development versions. From 1.00 up, they are production versions. |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 Machine-Readable Change Log |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
The file Changes was converted into Changelog.ini by L. |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 Support |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Email the author, or log a bug on RT: |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
L. |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 Author |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
L was written by Ron Savage Iron@savage.net.auE> in 2011. |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Home page: L. |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 Copyright |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Australian copyright (c) 2011, Ron Savage. |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
All Programs of mine are 'OSI Certified Open Source Software'; |
|
147
|
|
|
|
|
|
|
you can redistribute them and/or modify them under the terms of |
|
148
|
|
|
|
|
|
|
The Artistic License, a copy of which is available at: |
|
149
|
|
|
|
|
|
|
http://www.opensource.org/licenses/index.html |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |