lib/Grimlock/Web/Controller/Root.pm

filter: Statementstmt 82.7% 24 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 60.0% 3 / 5 totaltotal 73.9% 34 / 46 CC 1 SCAR 1.5
CC
1
Cov
83%
index_GET
2.0
default
2.0
BEGIN
1.0
CRAP 1.2
« lib/Grimlock/Schema/Candy.pm ↑ Summary lib/Grimlock.pm »
1 package Grimlock::Web::Controller::Root;
2 {
3 4 $Grimlock::Web::Controller::Root::VERSION = '0.11';
4 }
5 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶BEGIN { extends 'Grimlock::Web::Controller::API' }
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #
11 # Sets the actions in this controller to be registered with no prefix
12 # so they function identically to actions created in MyApp.pm
13 #
14 4 __PACKAGE__->config(namespace => '');
15  
16 =head1 NAME
17  
18 Grimlock::Web::Controller::Root - Root Controller for Grimlock::Web
19  
20 =head1 DESCRIPTION
21  
22 A sensible blog system.
23  
24 =head1 METHODS
25  
26 =cut
27  
28 4 ▶sub base : Chained('/api/base') PathPart('') CaptureArgs(0) {}
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine base: not called CC=1 SCAR=0.0
Pod undocumented
29  
30 =head2 index
31  
32 The root page (/)
33  
34 =cut
35  
36 4 ▶sub index :Chained('base') Path :Args(0) ActionClass('REST') {}
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine index: not called CC=1 SCAR=0.0
Pod documented
37  
38 0 ▶sub index_GET {
Subroutine index_GET: not called CC=1 SCAR=6.9
Pod undocumented
39 0 my ( $self, $c ) = @_;
40 0 return $self->status_ok($c,
41 entity => {
42 entries => [ $c->model('Database::Entry')->front_page_entries ]
43 }
44 );
45 }
46  
47 =head2 default
48  
49 Standard 404 error page
50  
51 =cut
52  
53 0 ▶sub default :Path {
Subroutine default: not called CC=1 SCAR=6.9
Pod documented
54 0 my ( $self, $c ) = @_;
55 0 $c->response->body( 'Page not found' );
56 0 $c->response->status(404);
57 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 =head2 end
60  
61 Attempt to render a view, if needed.
62  
63 =cut
64  
65 4 ▶sub end : ActionClass('RenderView') {}
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine end: not called CC=1 SCAR=0.0
Pod documented
66  
67 =head1 AUTHOR
68  
69 Devin Austin
70  
71 L<mailto:dhoss@cpan.org>
72  
73 =head1 LICENSE
74  
75 This library is free software. You can redistribute it and/or modify
76 it under the same terms as Perl itself.
77  
78 =cut
79  
80 4 __PACKAGE__->meta->make_immutable;
81  
82 4 1;
« lib/Grimlock/Schema/Candy.pm ↑ Summary lib/Grimlock.pm »