2 Commits

Author SHA1 Message Date
Florian Ragwitz
6b402d3357 Import of FLORA/CatalystX-REPL-0.03 from CPAN.
gitpan-cpan-distribution: CatalystX-REPL
gitpan-cpan-version:      0.03
gitpan-cpan-path:         FLORA/CatalystX-REPL-0.03.tar.gz
gitpan-cpan-author:       FLORA
gitpan-cpan-maturity:     released
2014-10-23 17:34:26 -05:00
Ash Berlin
46bb37363c Import of ASH/CatalystX-REPL-0.02 from CPAN.
gitpan-cpan-distribution: CatalystX-REPL
gitpan-cpan-version:      0.02
gitpan-cpan-path:         ASH/CatalystX-REPL-0.02.tar.gz
gitpan-cpan-author:       ASH
gitpan-cpan-maturity:     released
2014-10-23 17:34:26 -05:00
8 changed files with 64 additions and 16 deletions

View File

@@ -1,2 +1,8 @@
0.03 Fri, 10 Apr 2009 01:47:22 +0200
* Allow passing options to Carp::REPL.
0.02 Mon, 06 Apr 2009 22:28:52 +0100
* Doc improvmens (Ash Berlin, spurned on by Jon Rockway)
0.01 Thu, 26 Feb 2009 14:31:40 +0100
* Initial release.

View File

@@ -1,8 +1,9 @@
---
abstract: read-eval-print-loop for debugging your Catalyst application
author:
- Tomas Doram <bobtfish@bobtfish.net>
- Tomas Doran <bobtfish@bobtfish.net>
- Florian Ragwitz <rafl@debian.org>
- Ash Berlin <ash@cpan.org>
generated_by: Dist::Zilla::Plugin::MetaYaml version 1.004
license: perl
name: CatalystX-REPL
@@ -10,4 +11,4 @@ requires:
Carp::REPL: 0
Catalyst: 5.800006
namespace::clean: 0
version: 0.01
version: 0.03

View File

@@ -7,9 +7,9 @@ use ExtUtils::MakeMaker;
WriteMakefile(
DISTNAME => 'CatalystX-REPL',
NAME => 'CatalystX::REPL',
AUTHOR => 'Tomas\ Doram\ \<bobtfish\@bobtfish\.net\>\,\ Florian\ Ragwitz\ \<rafl\@debian\.org\>',
AUTHOR => 'Tomas\ Doran\ \<bobtfish\@bobtfish\.net\>\,\ Florian\ Ragwitz\ \<rafl\@debian\.org\>\,\ Ash\ Berlin\ \<ash\@cpan\.org\>',
ABSTRACT => 'read-eval-print-loop for debugging your Catalyst application',
VERSION => '0.01',
VERSION => '0.03',
EXE_FILES => [ qw() ],
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
PREREQ_PM => {

2
README
View File

@@ -1,7 +1,7 @@
This archive contains the distribution CatalystX-REPL, version
0.01:
0.03:
read-eval-print-loop for debugging your Catalyst application

View File

@@ -1,7 +1,8 @@
name = CatalystX-REPL
version = 0.01
author = Tomas Doram <bobtfish@bobtfish.net>
version = 0.03
author = Tomas Doran <bobtfish@bobtfish.net>
author = Florian Ragwitz <rafl@debian.org>
author = Ash Berlin <ash@cpan.org>
license = Perl_5
copyright_holder = Florian Ragwitz

View File

@@ -1,5 +1,5 @@
package CatalystX::REPL;
our $VERSION = '0.01';
our $VERSION = '0.03';
# ABSTRACT: read-eval-print-loop for debugging your Catalyst application
@@ -12,8 +12,9 @@ use namespace::clean -except => 'meta';
after setup_finalize => sub {
my ($self) = @_;
$SIG{__DIE__} = \&Carp::REPL::repl
if Catalyst::Utils::env_value($self, 'repl');
if (my $repl_options = Catalyst::Utils::env_value($self, 'repl')) {
Carp::REPL->import(split q{,}, $repl_options);
}
};
1;
@@ -25,7 +26,7 @@ CatalystX::REPL - read-eval-print-loop for debugging your Catalyst application
=head1 VERSION
version 0.01
version 0.03
=head1 SYNOPSIS
@@ -33,6 +34,7 @@ version 0.01
use Moose;
# Requires Catalyst 5.8 series
extends 'Catalyst';
with 'CatalystX::REPL';
@@ -42,13 +44,45 @@ version 0.01
=head1 DESCRIPTION
This role automatically sets up Carp::REPL after starting your application, if
the C<CATALYST_REPL> or C<MYAPP_REPL> environment variabeles are set.
Using L<Carp::REPL|Carp::REPL> with a Catalyst application is hard. That's
because of all the internal exceptions that are being thrown and caught by
Catalyst during application startup. You'd have to manually skip over all of
those.
This role works around that by automatically setting up Carp::REPL after
starting your application, if the C<CATALYST_REPL> or C<MYAPP_REPL> environment
variables are set:
MYAPP_REPL=1 ./script/myapp_server.pl
# Hit an action
...
42 at lib/MyApp/Controller/Foo.pm line 8.
# instead of exiting, you get a REPL!
Trace begun at lib/MyApp/Controller/Foo.pm line 8
MyApp::Controller::Foo::bar('MyApp::Controller::Foo=HASH(0xc9fe20)', 'MyApp=HASH(0xcea6a4)') called at ...
... # Many more lines of stack trace
$ $c
MyApp=HASH(0xcea6ec)
$ $c->req->uri
http://localhost/foo/bar
$
Options like C<warn> or C<nodie> can be passed to Carp::REPL by putting them,
seperated by commas, into the environment variable:
MYAPP_REPL=warn,nodie ./script/myapp_server.pl
Carp::REPL uses L<Devel::REPL> for the shell, so direct any questions how how
to use or customize the repl at that module.
=head1 AUTHORS
Tomas Doram <bobtfish@bobtfish.net>
Tomas Doran <bobtfish@bobtfish.net>
Florian Ragwitz <rafl@debian.org>
Ash Berlin <ash@cpan.org>
=head1 COPYRIGHT AND LICENSE
@@ -57,3 +91,9 @@ This software is copyright (c) 2009 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under
the same terms as perl itself.
=head1 SEE ALSO
L<Carp::REPL>
L<Devel::REPL>

View File

@@ -1,5 +1,5 @@
package TestApp;
our $VERSION = '0.01';
our $VERSION = '0.03';
use Moose;

View File

@@ -1,5 +1,5 @@
package TestApp::Controller::Foo;
our $VERSION = '0.01';
our $VERSION = '0.03';
use Moose;