[cgiapp] [Announce] CGI::Application::Plugin::Routes v1.01 now on cpan

P Kishor punk.kish at gmail.com
Wed Jun 10 15:11:55 EDT 2009


Hi,

CAP::Routes now installs fine, and seems to work, mostly. I am having
a bit of difficulty trying to make it work with CAP::Authentication
and as a replacement for CA::Dispatch .

With CAD and CAP::Authentication, I have the following that works

# in index.cgi
CGI::Application::Dispatch->dispatch(
    table => [
        welcome => { app => 'App', rm => 'welcome' },
        view    => { app => 'App', rm => 'view' },
    ],
);

# in App.pm
sub setup {
    my $self = shift;

    $self->start_mode("welcome");
    $self->mode_param(param => 'rm');
    $self->run_modes(
        welcome => 'welcome',
        view => 'view',
    );

    $self->authen->protected_runmodes('view');
}

Then I replace the above with the following
# in index.cgi
App->new(
    TMPL_PATH => ..,
    PARAMS    => {
       ..
    },
)->run();

# and in App.pm
sub setup {
	my $self = shift;

	$self->routes([
		welcome   => 'welcome',
		view      => 'view',
	]);
	$self->start_mode('welcome');

    $self->authen->protected_runmodes('view');
}

But now, I get the error "Error executing run mode 'authen_login':
Can't locate object method "authen_login" via package "App"...

This 'authen_login' run mode is being generated by the login form from
CAP::Authentication.

On Thu, Jun 4, 2009 at 7:44 PM, Porta<julian.porta at gmail.com> wrote:
> Damn typo...
> Thanks for the advice. Just uploaded the fixed version to cpan... should be
> available sometime tomorrow.
>
> I'll take a close look to the cpantesters (I haven't noticed it existence
> before).
>
>
> On Thu, Jun 4, 2009 at 9:19 PM, P Kishor <punk.kish at gmail.com> wrote:
>
>> On Thu, Jun 4, 2009 at 7:12 PM, Porta <julian.porta at gmail.com> wrote:
>> > Damn....
>> > thanks for the feedback... will look into it.
>> >
>>
>> Thanks. While you are investigating, note that it fails on just about
>> every platform. See
>>
>> http://www.cpantesters.org/distro/C/CGI-Application-Plugin-Routes.html
>>
>>
>> > On Thu, Jun 4, 2009 at 9:09 PM, P Kishor <punk.kish at gmail.com> wrote:
>> >
>> >> On Wed, Jun 3, 2009 at 5:28 PM, Porta <julian.porta at gmail.com> wrote:
>> >> > Hi folks.
>> >> >
>> >> > Just in case anyone's interested, CGI::Application::Plugin::Routes hit
>> >> v1.01
>> >> > and it's available on CPAN
>> >> >
>> >>
>> http://search.cpan.org/~porta/CGI-Application-Plugin-Routes-1.01/lib/CGI/Application/Plugin/Routes.pm<http://search.cpan.org/%7Eporta/CGI-Application-Plugin-Routes-1.01/lib/CGI/Application/Plugin/Routes.pm>
>> <
>> http://search.cpan.org/%7Eporta/CGI-Application-Plugin-Routes-1.01/lib/CGI/Application/Plugin/Routes.pm
>> >
>> >>
>> >> Install failed on my Mac OS X with Perl 5.8.8
>> >>
>> >> Writing Makefile for CGI::Application::Plugin::Routes
>> >> cp lib/CGI/Application/Plugin/Routes.pm
>> >> blib/lib/CGI/Application/Plugin/Routes.pm
>> >> Manifying blib/man3/CGI::Application::Plugin::Routes.3
>> >>  PORTA/CGI-Application-Plugin-Routes-1.01.tar.gz
>> >>  /usr/bin/make -- OK
>> >> Running make test
>> >> PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
>> >> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>> >> t/00-load.........Calling package is not a CGI::Application module so
>> >> not setting up the prerun hook.  If you are using @ISA instead of 'use
>> >> base', make sure it is in a BEGIN { } block, and make sure these
>> >> statements appear before the plugin is loaded at
>> >>
>> >>
>> /Users/punkish/.cpan/build/CGI-Application-Plugin-Routes-1.01-frSwPF/blib/lib/CGI/Application/Plugin/Routes.pm
>> >> line 25.
>> >> # Testing CGI::Application::Plugin::Routes 1.01, Perl 5.008008,
>> >> /usr/local/bin/perl
>> >> t/00-load.........ok
>> >> t/basic...........Error executing class callback in prerun stage:
>> >> Can't locate object method "route_params" via package "TestApp" at
>> >>
>> >>
>> /Users/punkish/.cpan/build/CGI-Application-Plugin-Routes-1.01-frSwPF/blib/lib/CGI/Application/Plugin/Routes.pm
>> >> line 104.
>> >> # Looks like your test exited with 2 before it could output anything.
>> >> t/basic...........dubious
>> >>        Test returned status 2 (wstat 512, 0x200)
>> >> t/boilerplate.....ok
>> >>        2/3 unexpectedly succeeded
>> >> TODO PASSED tests 2-3
>> >>
>> >> t/pod-coverage....
>> >> #   Failed test 'Pod coverage on CGI::Application::Plugin::Routes'
>> >> #   at /usr/local/lib/perl5/site_perl/5.8.8/Test/Pod/Coverage.pm line
>> 126.
>> >> # Coverage for CGI::Application::Plugin::Routes is 80.0%, with 1 naked
>> >> subroutine:
>> >> #       routes_params
>> >> t/pod-coverage....NOK 1/1# Looks like you failed 1 test of 1.
>> >> t/pod-coverage....dubious
>> >>        Test returned status 1 (wstat 256, 0x100)
>> >> DIED. FAILED test 1
>> >>        Failed 1/1 tests, 0.00% okay
>> >> t/pod.............ok
>> >> Failed Test      Stat Wstat Total Fail  List of Failed
>> >>
>> >>
>> -------------------------------------------------------------------------------
>> >> t/basic.t           2   512    ??   ??  ??
>> >> t/pod-coverage.t    1   256     1    1  1
>> >>  (2 subtests UNEXPECTEDLY SUCCEEDED).
>> >> Failed 2/5 test scripts. 1/6 subtests failed.
>> >> Files=5, Tests=6,  1 wallclock secs ( 0.19 cusr +  0.06 csys =  0.25
>> CPU)
>> >> Failed 2/5 test programs. 1/6 subtests failed.
>> >> make: *** [test_dynamic] Error 255
>> >>  PORTA/CGI-Application-Plugin-Routes-1.01.tar.gz
>> >>  /usr/bin/make test -- NOT OK
>> >> //hint// to see the cpan-testers results for installing this module,
>> try:
>> >>  reports PORTA/CGI-Application-Plugin-Routes-1.01.tar.gz
>> >> Running make install
>> >>  make test had returned bad status, won't install without force
>> >> Failed during this command:
>> >>  PORTA/CGI-Application-Plugin-Routes-1.01.tar.gz: make_test NO
>> >>
>> >>
>> >>
>> >> >
>> >> > Enjoy.
>> >> >
>> >> >
>> >> > Porta.
>> >> >


More information about the cgiapp mailing list