Any::Moose instead of Moose #1

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+15 −14
Split
View
@@ -1,13 +1,13 @@
package StackTrace::Auto;
-use Moose::Role 0.87;
+use Any::Moose 'Role';
# ABSTRACT: a role for generating stack traces during instantiation
=head1 SYNOPSIS
First, include StackTrace::Auto in a Moose class...
package Some::Class;
- use Moose;
+ use Any::Moose;
with 'StackTrace::Auto';
...then create an object of that class...
@@ -34,7 +34,7 @@ In general, you will not need to think about this attribute.
=cut
{
- use Moose::Util::TypeConstraints;
+ use Any::Moose 'Util::TypeConstraints';
has stack_trace => (
is => 'ro',
@@ -43,8 +43,9 @@ In general, you will not need to think about this attribute.
init_arg => undef,
);
+ require Class::Load;
my $tc = subtype as 'ClassName';
- coerce $tc, from 'Str', via { Class::MOP::load_class($_); $_ };
+ coerce $tc, from 'Str', via { Class::Load::load_class($_); $_ };
has stack_trace_class => (
is => 'ro',
@@ -54,7 +55,7 @@ In general, you will not need to think about this attribute.
builder => '_build_stack_trace_class',
);
- no Moose::Util::TypeConstraints;
+ no Any::Moose 'Util::TypeConstraints';
}
=attr stack_trace_args
@@ -113,5 +114,5 @@ sub __stack_marker {
return $self->$next(@_);
}
-no Moose::Role;
+no Any::Moose 'Role';
1;
View
@@ -1,11 +1,11 @@
package Throwable;
-use Moose::Role 0.87;
+use Any::Moose 'Role';
# ABSTRACT: a role for classes that can be thrown
=head1 SYNOPSIS
package Redirect;
- use Moose;
+ use Any::Moose;
with 'Throwable';
has url => (is => 'ro');
@@ -59,5 +59,5 @@ sub throw {
die $throwable;
}
-no Moose::Role;
+no Any::Moose 'Role';
1;
View
@@ -1,12 +1,12 @@
package Throwable::Error;
-use Moose 0.87;
+use Any::Moose;
with 'Throwable', 'StackTrace::Auto';
# ABSTRACT: an easy-to-use class for error objects
=head1 SYNOPSIS
package MyApp::Error;
- use Moose;
+ use Any::Moose;
extends 'Throwable::Error';
has execution_phase => (
@@ -95,5 +95,5 @@ sub BUILDARGS {
}
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
-no Moose;
+no Any::Moose;
1;
View
@@ -5,9 +5,9 @@ use Test::More tests => 9;
{
package MyError;
- use Moose;
+ use Any::Moose;
extends 'Throwable::Error';
- no Moose;
+ no Any::Moose;
}
sub throw_x {