line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Fake::MetaSyntactic; |
2
|
|
|
|
|
|
|
$Data::Fake::MetaSyntactic::VERSION = '1.000'; |
3
|
1
|
|
|
1
|
|
14738
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
3
|
use Exporter 5.57 qw( import ); |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
46
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @EXPORT = qw( fake_meta fake_metatheme ); |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
444
|
use Acme::MetaSyntactic (); |
|
1
|
|
|
|
|
8311
|
|
|
1
|
|
|
|
|
160
|
|
10
|
|
|
|
|
|
|
my @themes = grep $_ ne 'any', Acme::MetaSyntactic->themes; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub fake_meta { |
13
|
25
|
|
|
25
|
1
|
25050
|
my ($theme) = @_; |
14
|
25
|
|
33
|
|
|
56
|
$theme ||= fake_metatheme()->(); |
15
|
|
|
|
|
|
|
|
16
|
25
|
|
|
|
|
69
|
my $meta = Acme::MetaSyntactic->new; |
17
|
|
|
|
|
|
|
return sub { |
18
|
25
|
50
|
|
25
|
|
87
|
$meta->name( ref $theme eq 'CODE' ? $theme->() : $theme ); |
19
|
25
|
|
|
|
|
330
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub fake_metatheme { |
23
|
5
|
|
|
5
|
1
|
1477
|
return sub { $themes[ rand @themes ] }; |
|
1
|
|
|
1
|
|
335
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Data::Fake::MetaSyntactic - Fake metasyntactic data generators |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Data::Fake::MetaSyntactic; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
fake_metatheme()->(); # foo, donmartin, weekdays, etc. |
39
|
|
|
|
|
|
|
fake_meta()->(); # titi, GING_GOYNG, wednesday, etc. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This module provides fake data generators for L<Acme::MetaSyntactic>. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
All functions are exported by default. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 FUNCTIONS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 fake_meta |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$generator = fake_name( $theme ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Returns a generator that provides a randomly selected item from the |
54
|
|
|
|
|
|
|
given L<Acme::MetaSyntactic> theme. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
If no C<$theme> is given, a random theme is picked, among the installed |
57
|
|
|
|
|
|
|
ones. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 fake_metatheme |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$generator = fake_metatheme(); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns a generator that provides a random L<Acme::MetaSyntactic> theme name, |
64
|
|
|
|
|
|
|
among the installed ones. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Philippe Bruhat (BooK), <book@cpan.org>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Copyright 2015 Philippe Bruhat (BooK), all rights reserved. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
77
|
|
|
|
|
|
|
under the same terms as Perl itself. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |