File Coverage

blib/lib/OpenAPI/Generator.pm
Criterion Covered Total %
statement 19 20 95.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 27 29 93.1


line stmt bran cond sub pod time code
1             package OpenAPI::Generator;
2              
3 3     3   222589 use 5.006;
  3         31  
4 3     3   16 use strict;
  3         5  
  3         66  
5 3     3   15 use warnings;
  3         6  
  3         85  
6              
7 3     3   32 use Exporter qw(import);
  3         21  
  3         151  
8 3     3   21 use Carp;
  3         6  
  3         707  
9              
10             our $VERSION = '0.03';
11             our @EXPORT = qw(openapi_from);
12              
13             sub openapi_from {
14 4     4 1 136333 my($module, $conf) = @_;
15 4         27 $module = 'OpenAPI::Generator::From::'.join('', map { ucfirst lc } split /_/, "$module");
  4         34  
16              
17 4 50       501 unless (eval "require $module") {
18 0         0 croak "generator '$module' not found"
19             }
20              
21 4         37 $module->new->generate($conf)
22             }
23              
24             1
25              
26             __END__