line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Importer::Null; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
17
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
23
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
17
|
use Moo; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
30
|
|
8
|
2
|
|
|
2
|
|
1006
|
use namespace::clean; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Importer'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub generator { |
13
|
|
|
|
|
|
|
my ($self) = @_; |
14
|
|
|
|
|
|
|
my $n = 0; |
15
|
|
|
|
|
|
|
sub { |
16
|
|
|
|
|
|
|
return undef if $n++; |
17
|
|
|
|
|
|
|
+{}; |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Catmandu::Importer::Null - Null importer used for testing purposes |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# From the command line |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
catmandu convert Null --fix 'add_field(foo,bar)' |
36
|
|
|
|
|
|
|
# creates { "foo": "bar" } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# In a Perl script |
39
|
|
|
|
|
|
|
use Catmandu; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $importer = Catmandu->importer('Null'); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $n = $importer->each(sub { |
44
|
|
|
|
|
|
|
my $hashref = $_[0]; |
45
|
|
|
|
|
|
|
# ... |
46
|
|
|
|
|
|
|
}); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
The importer generates one empty record and then exists. This importer can be used to |
51
|
|
|
|
|
|
|
test fix functions, generating a single record. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Every L<Catmandu::Importer> is a L<Catmandu::Iterable> all its methods are |
56
|
|
|
|
|
|
|
inherited. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SEE ALSO |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L<Catmandu::Exporter::Null> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |