line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::BDD::Cucumber::Model::Document; |
2
|
|
|
|
|
|
|
$Test::BDD::Cucumber::Model::Document::VERSION = '0.84'; |
3
|
18
|
|
|
18
|
|
150
|
use Moo; |
|
18
|
|
|
|
|
78
|
|
|
18
|
|
|
|
|
134
|
|
4
|
18
|
|
|
18
|
|
5972
|
use Types::Standard qw( Str ArrayRef InstanceOf ); |
|
18
|
|
|
|
|
76
|
|
|
18
|
|
|
|
|
137
|
|
5
|
18
|
|
|
18
|
|
23258
|
use Test::BDD::Cucumber::Model::Line; |
|
18
|
|
|
|
|
71
|
|
|
18
|
|
|
|
|
3982
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Test::BDD::Cucumber::Model::Document - Model to represent a feature file on disk or in memory |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
version 0.84 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Model to represent a feature file on disk or in memory |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 filename |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
The filename from which the document was loaded. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has 'filename' => ( is => 'ro', isa => Str ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 content |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
The file contents, as a string |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has 'content' => ( is => 'ro', isa => Str ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 lines |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
The file contents, as an arrayref of L |
40
|
|
|
|
|
|
|
objects |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has 'lines' => ( |
45
|
|
|
|
|
|
|
is => 'rw', |
46
|
|
|
|
|
|
|
default => sub { [] }, |
47
|
|
|
|
|
|
|
isa => ArrayRef[InstanceOf['Test::BDD::Cucumber::Model::Line']] |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 OTHER |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 BUILD |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
The instantiation populates C by splitting the input on newlines. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# Create lines |
59
|
|
|
|
|
|
|
sub BUILD { |
60
|
48
|
|
|
48
|
1
|
1710
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# Reset any content that was in lines |
63
|
48
|
|
|
|
|
125
|
my $counter = 0; |
64
|
|
|
|
|
|
|
|
65
|
48
|
|
|
|
|
903
|
for my $line ( split( /\n/, $self->content ) ) { |
66
|
1251
|
|
|
|
|
27957
|
my $obj = Test::BDD::Cucumber::Model::Line->new( |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
number => ++$counter, |
69
|
|
|
|
|
|
|
document => $self, |
70
|
|
|
|
|
|
|
raw_content => $line |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
); |
73
|
1251
|
|
|
|
|
121934
|
push( @{ $self->lines }, $obj ); |
|
1251
|
|
|
|
|
22149
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Peter Sergeant C |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Copyright 2019-2023, Erik Huelsmann |
84
|
|
|
|
|
|
|
Copyright 2011-2019, Peter Sergeant; Licensed under the same terms as Perl |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |