lib/CPAN/Mini/Inject/REST.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 21 / 21 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/CPAN/Mini/Inject/REST/Controller/Root.pm ↑ Summary lib/CPAN/Mini/Inject/REST/Model/CMI.pm »
1 package CPAN::Mini::Inject::REST;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Catalyst::Runtime 5.80;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # Set flags and add plugins for the application.
8 #
9 # Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
10 # therefore you almost certainly want to keep ConfigLoader at the head of the
11 # list if you're using it.
12 #
13 # -Debug: activates the debug mode for very useful log messages
14 # ConfigLoader: will load the configuration from a Config::General file in the
15 # application's home directory
16 # Static::Simple: will serve static files from the application's root
17 # directory
18  
19 1 ▶use Catalyst qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
20 ConfigLoader
21 Static::Simple
22 1 /;
23  
24 1 extends 'Catalyst';
25  
26 1 our $VERSION = '0.03';
27  
28 # Configure the application.
29 #
30 # Note that settings in cpan_mini_inject_rest.conf (or other external
31 # configuration file that you set up manually) take precedence
32 # over this when using ConfigLoader. Thus configuration
33 # details given here can function as a default configuration,
34 # with an external configuration file acting as an override for
35 # local deployment.
36  
37 1 __PACKAGE__->config(
38 name => 'CPAN::Mini::Inject::REST',
39 # Disable deprecated behavior needed by old applications
40 disable_component_resolution_regex_fallback => 1,
41 );
42  
43 # Start the application
44 1 __PACKAGE__->setup();
45  
46  
47 =head1 NAME
48  
49 CPAN::Mini::Inject::REST - Remote API for CPAN::Mini::Inject
50  
51 =head1 SYNOPSIS
52  
53 script/cpan_mini_inject_rest_server.pl
54  
55 =head1 DESCRIPTION
56  
57 Provides a REST API for remote access to a CPAN::Mini::Inject mirror.
58  
59 Using the API, the contents of the repository can be queried and new
60 distributions added. See L<CPAN::Mini::Inject::REST::Controller::API::Version1_0>
61 for full details of the API features and documentation.
62  
63 =head1 INSTALLATION
64  
65 The API is a Catalyst application, so can be used with any webserver
66 supported by Catalyst or Plack.
67  
68 You must already have a L<CPAN::Mini::Inject> mirror configured and working
69 on your machine. Set the path to your mirror's config file in F<cpan_mini_inject_rest.conf>.
70  
71 Note that in order for files to be added to the repository, the
72 API must be running as a user with write access to the underlying
73 CPAN::Mini::Mirror itself.
74  
75 =head1 SEE ALSO
76  
77 L<CPAN::Mini::Inject::REST::Client>
78  
79 L<CPAN::Mini::Inject>
80  
81 =head1 AUTHOR
82  
83 Jon Allen (JJ) <jj@jonallen.info>
84  
85 =head1 LICENSE
86  
87 Copyright (C) 2011 Jon Allen
88  
89 This library is free software. You can redistribute it and/or modify
90 it under the same terms as Perl itself.
91  
92 =cut
93  
94 1 1;
« lib/CPAN/Mini/Inject/REST/Controller/Root.pm ↑ Summary lib/CPAN/Mini/Inject/REST/Model/CMI.pm »