blib/lib/Catmandu/Cmd/repl.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 59.2% 16 / 27 CC 2 SCAR 10.4
CC
2
Cov
55%
command
6.0
command_opt_spec
2.0
BEGIN
1.0
CRAP 2.8
↑ Summary
1 package Catmandu::Cmd::repl;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use parent 'Catmandu::Cmd';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Devel::REPL;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Catmandu::Cmd::repl - interactive shell for Catmandu
10  
11 =head1 VERSION
12  
13 Version 0.01
14  
15 =cut
16  
17 1 our $VERSION = '0.01';
18  
19 =head1 SYNOPSIS
20  
21 catmandu repl
22  
23 =cut
24  
25 0 ▶sub command_opt_spec {
Subroutine command_opt_spec: not called CC=1 SCAR=6.9
Pod documented
26 0 ();
27 }
28  
29 0 ▶sub command {
Subroutine command: not called CC=2 SCAR=17.9
Pod documented
30 0 my ($self, $opts, $args) = @_;
31  
32 0 my @plugins = qw(LexEnv DDC Packages Commands MultiLine::PPI Colors);
33  
34 0 my $init = <<PERL;
35 use Catmandu::Sane;
36 use Catmandu qw(:all);
37 PERL
38  
39 0 my $repl = Devel::REPL->new;
40 0 $repl->load_plugin($_) for @plugins;
41 0 $repl->current_package('main');
42 0 $repl->eval($init);
43 0 $repl->run;
44 }
45  
46 =head1 AUTHOR
47  
48 Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>
49  
50 =head1 LICENSE AND COPYRIGHT
51  
52 Copyright 2012 Ghent University Library
53  
54 This program is free software; you can redistribute it and/or modify it
55 under the terms of either: the GNU General Public License as published
56 by the Free Software Foundation; or the Artistic License.
57  
58 See http://dev.perl.org/licenses/ for more information.
59  
60 =cut
61  
62 1 1;
↑ Summary