QuoteCC/Role/Input.pm

filter: Statementstmt 65.5% 19 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 68.4% 26 / 38 CC 1 SCAR 1.2
CC
1
Cov
66%
file_handle
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« QuoteCC.pm ↑ Summary QuoteCC/Input/Fortune.pm »
1 package App::QuoteCC::Role::Input;
2 4 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 $App::QuoteCC::Role::Input::AUTHORITY = 'cpan:AVAR';
4 }
5 4 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 $App::QuoteCC::Role::Input::VERSION = '0.10';
7 }
8  
9 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 has file => (
16 isa => 'Str',
17 is => 'ro',
18 documentation => 'The quotes file to compile from. - for STDIN',
19 );
20  
21 0 ▶sub file_handle {
Subroutine file_handle: not called CC=1 SCAR=6.9
Pod undocumented
22 0 my ($self) = @_;
23 0 my $file = $self->file;
24  
25 0 given ($file) {
26 0 when ('-') {
27 0 binmode STDIN;
28 0 return *STDIN;
29 }
30 0 default {
31 0 open my $fh, '<', $file;
32 0 binmode $fh;
33 0 return $fh;
34 }
35 }
36 }
37  
38 4 requires 'quotes';
39  
40 4 1;
41  
42 =encoding utf8
43  
44 =head1 NAME
45  
46 App::QuoteCC::Role::Input - A role representing a L<App::QuoteCC> input format
47  
48 =head1 AUTHOR
49  
50 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avar@cpan.org>
51  
52 =head1 LICENSE AND COPYRIGHT
53  
54 Copyright 2010 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason.
55  
56 This program is free software, you can redistribute it and/or modify
57 it under the same terms as Perl itself.
58  
59 =cut
60  
« QuoteCC.pm ↑ Summary QuoteCC/Input/Fortune.pm »