Skip to content

Commit

Permalink
Class::Data::Accessor --> MooseX::ClassAttribute
Browse files Browse the repository at this point in the history
* bump module version number
* add missing accessor clearing
* update test apps
* fix version string in email emit test
  • Loading branch information
chizmw committed Jul 18, 2011
1 parent 219fdb3 commit fa74012
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 24 deletions.
2 changes: 1 addition & 1 deletion dist.ini
@@ -1,5 +1,5 @@
name = Catalyst-Plugin-ErrorCatcher
version = 0.0.8.8
version = 0.0.8.9
author = Chisel Wright <chisel@chizography.net>
license = Perl_5
copyright_holder = Chisel Wright
Expand Down
39 changes: 29 additions & 10 deletions lib/Catalyst/Plugin/ErrorCatcher.pm
@@ -1,19 +1,37 @@
package Catalyst::Plugin::ErrorCatcher;
# ABSTRACT: Catch application errors and emit them somewhere
use strict;
use warnings;
use Moose;
use MooseX::ClassAttribute;
use 5.008001;
use base qw/Class::Data::Accessor/;
use IO::File;
use MRO::Compat;
use Module::Pluggable::Object;

__PACKAGE__->mk_classaccessor(qw/_errorcatcher/);
__PACKAGE__->mk_classaccessor(qw/_errorcatcher_msg/);
__PACKAGE__->mk_classaccessor(qw/_errorcatcher_cfg/);
__PACKAGE__->mk_classaccessor(qw/_errorcatcher_c_cfg/);
__PACKAGE__->mk_classaccessor(qw/_errorcatcher_first_frame/);
__PACKAGE__->mk_classaccessor(qw/_errorcatcher_emitter_of/);
class_has '_errorcatcher' => (
is => 'rw',
isa => 'ArrayRef|Undef',
);
class_has '_errorcatcher_msg' => (
is => 'rw',
isa => 'Str|Undef',
);
class_has '_errorcatcher_cfg' => (
is => 'rw',
isa => 'HashRef',
);
class_has '_errorcatcher_c_cfg' => (
is => 'rw',
isa => 'HashRef',
);
class_has '_errorcatcher_first_frame' => (
is => 'rw',
);
class_has '_errorcatcher_emitter_of' => (
is => 'rw',
);

__PACKAGE__->meta()->make_immutable();
no Moose;
no MooseX::ClassAttribute;

sub setup {
my $c = shift @_;
Expand Down Expand Up @@ -419,6 +437,7 @@ sub _keep_frames {
$c->_errorcatcher( $stacktrace );
}
else {
$c->_errorcatcher( undef );
$c->log->debug(
__PACKAGE__
. q{ has no stack-trace information}
Expand Down
2 changes: 1 addition & 1 deletion t/05.emit.email.t
Expand Up @@ -94,7 +94,7 @@ use Catalyst::Test 'TestApp';
{ sub => 'Line: %l', res => qq{Line: 30} },
{ sub => 'File: %F', res => qq{File: TestApp/Controller/Foo.pm} },
{ sub => 'Package: %p', res => qq{Package: TestApp::Controller::Foo} },
{ sub => 'Version: %V', res => qq{Version: v0.0.3} },
{ sub => 'Version: %V', res => qq{Version: v0.0.4} },
{ sub => 'Name: %n', res => qq{Name: TestApp} },
);

Expand Down
13 changes: 7 additions & 6 deletions t/lib/NoAuth.pm
@@ -1,10 +1,11 @@
package NoAuth;
# vim: ts=8 sts=4 et sw=4 sr sta
use strict;
use warnings;
use Catalyst;
use Moose;
extends 'Catalyst';
use namespace::autoclean;
use Catalyst::Runtime 5.80;

our $VERSION = '0.0.2';
our $VERSION = '0.0.3';

# hide debug output at startup
{
Expand All @@ -14,7 +15,7 @@ our $VERSION = '0.0.2';
*{"Catalyst\::Log\::info"} = sub { };
}

NoAuth->config(
__PACKAGE__->config(
name => 'NoAuth',
);

Expand All @@ -26,7 +27,7 @@ VERSION_MADNESS: {
);
}

NoAuth->setup(
__PACKAGE__->setup(
qw<
-Debug
StackTrace
Expand Down
13 changes: 7 additions & 6 deletions t/lib/TestApp.pm
@@ -1,10 +1,11 @@
package TestApp;
# vim: ts=8 sts=4 et sw=4 sr sta
use strict;
use warnings;
use Catalyst;
use Moose;
extends 'Catalyst';
use namespace::autoclean;
use Catalyst::Runtime 5.80;

our $VERSION = '0.0.3';
our $VERSION = '0.0.4';

# hide debug output at startup
{
Expand All @@ -14,7 +15,7 @@ our $VERSION = '0.0.3';
*{"Catalyst\::Log\::info"} = sub { };
}

TestApp->config(
__PACKAGE__->config(
name => 'TestApp',

'Plugin::Authentication' => {
Expand Down Expand Up @@ -44,7 +45,7 @@ VERSION_MADNESS: {
);
}

TestApp->setup(
__PACKAGE__->setup(
qw<
-Debug
StackTrace
Expand Down

0 comments on commit fa74012

Please sign in to comment.