Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
fcuny committed May 13, 2009
0 parents commit 9254744
Show file tree
Hide file tree
Showing 24 changed files with 549 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -0,0 +1,4 @@
This file documents the revision history for Perl extension MyFeedReader.

0.01 2009-05-13 13:44:17
- initial revision, generated by Catalyst
19 changes: 19 additions & 0 deletions Makefile.PL
@@ -0,0 +1,19 @@
# IMPORTANT: if you delete this file your app will not work as
# expected. you have been warned
use inc::Module::Install;

name 'MyFeedReader';
all_from 'lib/MyFeedReader.pm';

requires 'Catalyst::Runtime' => '5.80001';
requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::Static::Simple';
requires 'Catalyst::Action::RenderView';
requires 'parent';
requires 'Config::General'; # This should reflect the config file format you've chosen
# See Catalyst::Plugin::ConfigLoader for supported formats
catalyst;

install_script glob('script/*.pl');
auto_install;
WriteAll;
1 change: 1 addition & 0 deletions README
@@ -0,0 +1 @@
Run script/myfeedreader_server.pl to test the application.
64 changes: 64 additions & 0 deletions lib/MyFeedReader.pm
@@ -0,0 +1,64 @@
package MyFeedReader;

use strict;
use warnings;

use Catalyst::Runtime '5.70';

# Set flags and add plugins for the application
#
# -Debug: activates the debug mode for very useful log messages
# ConfigLoader: will load the configuration from a Config::General file in the
# application's home directory
# Static::Simple: will serve static files from the application's root
# directory

use parent qw/Catalyst/;
use Catalyst qw/-Debug
ConfigLoader
Static::Simple/;
our $VERSION = '0.01';

# Configure the application.
#
# Note that settings in myfeedreader.conf (or other external
# configuration file that you set up manually) take precedence
# over this when using ConfigLoader. Thus configuration
# details given here can function as a default configuration,
# with an external configuration file acting as an override for
# local deployment.

__PACKAGE__->config( name => 'MyFeedReader' );

# Start the application
__PACKAGE__->setup();


=head1 NAME
MyFeedReader - Catalyst based application
=head1 SYNOPSIS
script/myfeedreader_server.pl
=head1 DESCRIPTION
[enter your description here]
=head1 SEE ALSO
L<MyFeedReader::Controller::Root>, L<Catalyst>
=head1 AUTHOR
,,,
=head1 LICENSE
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

1;
61 changes: 61 additions & 0 deletions lib/MyFeedReader/Controller/Root.pm
@@ -0,0 +1,61 @@
package MyFeedReader::Controller::Root;

use strict;
use warnings;
use parent 'Catalyst::Controller';

#
# Sets the actions in this controller to be registered with no prefix
# so they function identically to actions created in MyApp.pm
#
__PACKAGE__->config->{namespace} = '';

=head1 NAME
MyFeedReader::Controller::Root - Root Controller for MyFeedReader
=head1 DESCRIPTION
[enter your description here]
=head1 METHODS
=cut

=head2 index
=cut

sub index :Path :Args(0) {
my ( $self, $c ) = @_;

# Hello World
$c->response->body( $c->welcome_message );
}

sub default :Path {
my ( $self, $c ) = @_;
$c->response->body( 'Page not found' );
$c->response->status(404);
}

=head2 end
Attempt to render a view, if needed.
=cut

sub end : ActionClass('RenderView') {}

=head1 AUTHOR
,,,
=head1 LICENSE
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

1;
3 changes: 3 additions & 0 deletions myfeedreader.conf
@@ -0,0 +1,3 @@
# rename this file to MyFeedReader.yml and put a : in front of "name" if
# you want to use yaml like in old versions of Catalyst
name MyFeedReader
Binary file added root/favicon.ico
Binary file not shown.
Binary file added root/static/images/btn_120x50_built.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_120x50_built_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_120x50_powered.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_120x50_powered_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_88x31_built.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_88x31_built_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_88x31_powered.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/btn_88x31_powered_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added root/static/images/catalyst_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions script/myfeedreader_cgi.pl
@@ -0,0 +1,37 @@
#!/usr/bin/env perl

BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }

use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MyFeedReader;

MyFeedReader->run;

1;

=head1 NAME
myfeedreader_cgi.pl - Catalyst CGI
=head1 SYNOPSIS
See L<Catalyst::Manual>
=head1 DESCRIPTION
Run a Catalyst application as a cgi script.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
85 changes: 85 additions & 0 deletions script/myfeedreader_create.pl
@@ -0,0 +1,85 @@
#!/usr/bin/env perl

use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
eval "use Catalyst::Helper;";

if ($@) {
die <<END;
To use the Catalyst development tools including catalyst.pl and the
generated script/myapp_create.pl you need Catalyst::Helper, which is
part of the Catalyst-Devel distribution. Please install this via a
vendor package or by running one of -
perl -MCPAN -e 'install Catalyst::Devel'
perl -MCPANPLUS -e 'install Catalyst::Devel'
END
}

my $force = 0;
my $mech = 0;
my $help = 0;

GetOptions(
'nonew|force' => \$force,
'mech|mechanize' => \$mech,
'help|?' => \$help
);

pod2usage(1) if ( $help || !$ARGV[0] );

my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );

pod2usage(1) unless $helper->mk_component( 'MyFeedReader', @ARGV );

1;

=head1 NAME
myfeedreader_create.pl - Create a new Catalyst Component
=head1 SYNOPSIS
myfeedreader_create.pl [options] model|view|controller name [helper] [options]
Options:
-force don't create a .new file where a file to be created exists
-mechanize use Test::WWW::Mechanize::Catalyst for tests if available
-help display this help and exits
Examples:
myfeedreader_create.pl controller My::Controller
myfeedreader_create.pl -mechanize controller My::Controller
myfeedreader_create.pl view My::View
myfeedreader_create.pl view MyView TT
myfeedreader_create.pl view TT TT
myfeedreader_create.pl model My::Model
myfeedreader_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
dbi:SQLite:/tmp/my.db
myfeedreader_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
dbi:Pg:dbname=foo root 4321
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
=head1 DESCRIPTION
Create a new Catalyst Component.
Existing component files are not overwritten. If any of the component files
to be created already exist the file will be written with a '.new' suffix.
This behavior can be suppressed with the C<-force> option.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
79 changes: 79 additions & 0 deletions script/myfeedreader_fastcgi.pl
@@ -0,0 +1,79 @@
#!/usr/bin/env perl

BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }

use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MyFeedReader;

my $help = 0;
my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );

GetOptions(
'help|?' => \$help,
'listen|l=s' => \$listen,
'nproc|n=i' => \$nproc,
'pidfile|p=s' => \$pidfile,
'manager|M=s' => \$manager,
'daemon|d' => \$detach,
'keeperr|e' => \$keep_stderr,
);

pod2usage(1) if $help;

MyFeedReader->run(
$listen,
{ nproc => $nproc,
pidfile => $pidfile,
manager => $manager,
detach => $detach,
keep_stderr => $keep_stderr,
}
);

1;

=head1 NAME
myfeedreader_fastcgi.pl - Catalyst FastCGI
=head1 SYNOPSIS
myfeedreader_fastcgi.pl [options]
Options:
-? -help display this help and exits
-l -listen Socket path to listen on
(defaults to standard input)
can be HOST:PORT, :PORT or a
filesystem path
-n -nproc specify number of processes to keep
to serve requests (defaults to 1,
requires -listen)
-p -pidfile specify filename for pid file
(requires -listen)
-d -daemon daemonize (requires -listen)
-M -manager specify alternate process manager
(FCGI::ProcManager sub-class)
or empty string to disable
-e -keeperr send error messages to STDOUT, not
to the webserver
=head1 DESCRIPTION
Run a Catalyst application as fastcgi.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

0 comments on commit 9254744

Please sign in to comment.