File Coverage

blib/lib/OpenAPI/Generator.pm
Criterion Covered Total %
statement 17 18 94.4
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 24 26 92.3


line stmt bran cond sub pod time code
1             package OpenAPI::Generator;
2              
3 3     3   219035 use strict;
  3         29  
  3         94  
4 3     3   15 use warnings;
  3         6  
  3         92  
5              
6 3     3   15 use Exporter qw(import);
  3         14  
  3         83  
7 3     3   15 use Carp;
  3         6  
  3         703  
8              
9             our $VERSION = '0.05';
10             our @EXPORT = qw(openapi_from);
11              
12             sub openapi_from {
13 4     4 1 35824 my($module, $conf) = @_;
14 4         24 $module = 'OpenAPI::Generator::From::'.join('', map { ucfirst lc } split /_/, "$module");
  4         34  
15              
16 4 50       388 unless (eval "require $module") {
17 0         0 croak "generator '$module' not found"
18             }
19              
20 4         34 $module->new->generate($conf)
21             }
22              
23             1
24              
25             __END__