Any::Moose is deprecated, and the autocoerce meta trait does not work
anymore with Moose.
41 files changed:
$file = "lib/$file.pm";
my %PREREQ_PM = (
$file = "lib/$file.pm";
my %PREREQ_PM = (
'Carp' => 0,
'List::Util' => 0,
'Math::Complex' => 0,
'Carp' => 0,
'List::Util' => 0,
'Math::Complex' => 0,
-L<Any::Moose> with L<Mouse> 0.80 or greater.
+L<Mouse> 0.80 or greater.
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
-__PACKAGE__->meta->make_immutable if any_moose() ne 'Moose';
+__PACKAGE__->meta->make_immutable;
-use Any::Moose;
-use Any::Moose 'Util' => [ qw<find_meta does_role> ];
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util qw<find_meta does_role>;
+use Mouse::Util::TypeConstraints;
my $meta = find_meta($target);
Carp::confess("No meta object associated with target $target")
unless defined $meta;
my $meta = find_meta($target);
Carp::confess("No meta object associated with target $target")
unless defined $meta;
- $args{is_role} = $meta->isa(any_moose('Meta::Role'));
+ $args{is_role} = $meta->isa('Mouse::Meta::Role');
my $is_set;
if (does_role($target, 'LaTeX::TikZ::Set')) {
my $is_set;
if (does_role($target, 'LaTeX::TikZ::Set')) {
# The target class of the autocoercion (cannot be changed)
{
package X;
# The target class of the autocoercion (cannot be changed)
{
package X;
has 'id' => (
is => 'ro',
isa => 'Int',
);
use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
has 'id' => (
is => 'ro',
isa => 'Int',
);
use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
- use Any::Moose 'Util::TypeConstraints';
+ use Mouse::Util::TypeConstraints;
register_type_constraint(
LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
name => 'X::Autocoerce',
register_type_constraint(
LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
name => 'X::Autocoerce',
# The class that does the coercion (cannot be changed)
{
package Y;
# The class that does the coercion (cannot be changed)
{
package Y;
has 'x' => (
is => 'ro',
isa => 'X::Autocoerce',
coerce => 1,
handles => [ 'id' ],
);
has 'x' => (
is => 'ro',
isa => 'X::Autocoerce',
coerce => 1,
handles => [ 'id' ],
);
- # This class shouldn't be immutable when using Moose, or the
- # coercing attributes will not be updated with the future coercions.
- __PACKAGE__->meta->make_immutable if any_moose() ne 'Moose';
+ __PACKAGE__->meta->make_immutable;
}
# Another class the user wants to use instead of X (cannot be changed)
{
package Z;
}
# Another class the user wants to use instead of X (cannot be changed)
{
package Z;
has 'id' => (
is => 'ro',
isa => 'Num',
has 'id' => (
is => 'ro',
isa => 'Num',
# The autocoercion class, defined by the user in X/From/Z.pm
{
package X::From::Z;
# The autocoercion class, defined by the user in X/From/Z.pm
{
package X::From::Z;
- use Any::Moose 'Util::TypeConstraints';
+ use Mouse::Util::TypeConstraints;
coerce 'X::Autocoerce'
=> from 'Z'
=> via { X->new(id => int $_->id) };
coerce 'X::Autocoerce'
=> from 'Z'
=> via { X->new(id => int $_->id) };
When a type coercion is attempted, this type constraint metaclass tries to autoload a specific module which is supposed to contain the actual coercion code.
This allows you to declare types that can be replaced (through coercion) at the end user's discretion.
When a type coercion is attempted, this type constraint metaclass tries to autoload a specific module which is supposed to contain the actual coercion code.
This allows you to declare types that can be replaced (through coercion) at the end user's discretion.
-It works with both L<Moose> and L<Mouse> by using L<Any::Moose>.
+It only supports L<Mouse> currently.
-Note that you will need L<Moose::Util::TypeConstraints/register_type_constraint> or L<Mouse::Util::TypeConstraints/register_type_constraint> to install this type constraint, and that the latter is only available starting L<Mouse> C<0.63>.
+Note that you will need L<Mouse::Util::TypeConstraints/register_type_constraint> to install this type constraint, which is only available starting L<Mouse> C<0.63>.
-This class inherits from L<Moose::Meta::TypeConstraint> or L<Mouse::Meta::TypeConstraint>, depending on which mode L<Any::Moose> runs.
+This class inherits from L<Mouse::Meta::TypeConstraint>.
-extends any_moose('Meta::TypeConstraint');
+extends 'Mouse::Meta::TypeConstraint';
The name of the type constraint.
This must be the target of both the classes that want to use the autocoercion feature and the user defined coercions in the autoloaded classes.
The name of the type constraint.
This must be the target of both the classes that want to use the autocoercion feature and the user defined coercions in the autoloaded classes.
-This attribute is inherited from the L<Moose> or L<Mouse> type constraint metaclass.
+This attribute is inherited from the L<Mouse> type constraint metaclass.
has 'target' => (
is => 'ro',
has 'target' => (
is => 'ro',
- isa => any_moose('Meta::TypeConstraint'),
+ isa => 'Mouse::Meta::TypeConstraint',
$target_tc->assert_valid($target);
$args{target} = $target;
$target_tc->assert_valid($target);
$args{target} = $target;
- if (any_moose() eq 'Moose') {
- $args{coercion} = Moose::Meta::TypeCoercion->new;
- }
-
$args{constraint} = Sub::Name::subname('_constraint' => sub {
my ($thing) = @_;
$args{constraint} = Sub::Name::subname('_constraint' => sub {
my ($thing) = @_;
-L<Moose::Meta::TypeConstraint>, L<Mouse::Meta::TypeConstraint>.
+L<Mouse::Meta::TypeConstraint>.
-use Any::Moose 'Role';
-use Any::Moose 'Util::TypeConstraints';
+use Mouse::Role;
+use Mouse::Util::TypeConstraints;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints' => [
- 'enum',
- qw<coerce from via>,
-];
+use Mouse;
+use Mouse::Util::TypeConstraints qw<enum coerce from via>;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints' => [ qw<
- coerce
- from
- via
+use Mouse;
+use Mouse::Util::TypeConstraints qw<
+ coerce from via
find_type_constraint
register_type_constraint
find_type_constraint
register_type_constraint
-use Any::Moose 'Util::TypeConstraints' => [ qw<
- class_type
- coerce
- from
- via
-> ];
+use Mouse::Util::TypeConstraints qw<class_type coerce from via>;
my $mc_tc = class_type 'Math::Complex';
my $mc_tc = class_type 'Math::Complex';
-use Any::Moose 'Util::TypeConstraints' => [ 'find_type_constraint' ];
+use Mouse::Util::TypeConstraints 'find_type_constraint';
my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Interface;
-use Any::Moose 'Util::TypeConstraints' => [ 'find_type_constraint' ];
+use Mouse::Util::TypeConstraints 'find_type_constraint';
my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints' => [ qw<subtype as coerce from via> ];
+use Mouse;
+use Mouse::Util::TypeConstraints qw<subtype as coerce from via>;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
-__PACKAGE__->meta->make_immutable if any_moose() ne 'Moose';
+__PACKAGE__->meta->make_immutable;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
use LaTeX::TikZ::Interface;
use LaTeX::TikZ::Functor;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints'
- => [ qw<subtype as where find_type_constraint> ];
+use Mouse;
+use Mouse::Util::TypeConstraints qw<subtype as where find_type_constraint>;
-use Any::Moose 'Util::TypeConstraints' => [ 'find_type_constraint' ];
+use Mouse::Util::TypeConstraints 'find_type_constraint';
}
diag( "Testing LaTeX::TikZ $LaTeX::TikZ::VERSION, Perl $], $^X" );
}
diag( "Testing LaTeX::TikZ $LaTeX::TikZ::VERSION, Perl $], $^X" );
-
-use Any::Moose;
-
-my $moose = any_moose();
-my $version = do { no strict 'refs'; ${$moose . '::VERSION'} };
-
-diag( "Any::Moose uses $moose $version" );
{
package LaTeX::TikZ::TestX;
{
package LaTeX::TikZ::TestX;
- use Any::Moose;
- use Any::Moose 'Util::TypeConstraints' => [ qw<
- coerce
- from
- via
+ use Mouse;
+ use Mouse::Util::TypeConstraints qw<
+ coerce from via
find_type_constraint
register_type_constraint
find_type_constraint
register_type_constraint
has 'id' => (
is => 'ro',
has 'id' => (
is => 'ro',
{
package LaTeX::TikZ::TestY;
{
package LaTeX::TikZ::TestY;
has 'num' => (
is => 'ro',
has 'num' => (
is => 'ro',
{
package LaTeX::TikZ::TestZ;
{
package LaTeX::TikZ::TestZ;
- __PACKAGE__->meta->make_immutable if any_moose() ne 'Moose';
+ __PACKAGE__->meta->make_immutable;
sub main::Z () { __PACKAGE__ }
}
sub main::Z () { __PACKAGE__ }
}
{
package LaTeX::TikZ::TestW;
{
package LaTeX::TikZ::TestW;
- use Any::Moose;
- use Any::Moose 'Util::TypeConstraints';
+ use Mouse;
+ use Mouse::Util::TypeConstraints;
-my $moose_private = { also_private => [ qr/^BUILD$/, qr/^DEMOLISH$/ ] };
+my $mouse_private = { also_private => [ qr/^BUILD$/, qr/^DEMOLISH$/ ] };
# First load the interface so that no keywords are registered.
pod_coverage_ok( 'LaTeX::TikZ::Interface' );
pod_coverage_ok( 'LaTeX::TikZ' );
# First load the interface so that no keywords are registered.
pod_coverage_ok( 'LaTeX::TikZ::Interface' );
pod_coverage_ok( 'LaTeX::TikZ' );
-pod_coverage_ok( 'LaTeX::TikZ::Context', $moose_private );
+pod_coverage_ok( 'LaTeX::TikZ::Context', $mouse_private );
pod_coverage_ok( 'LaTeX::TikZ::Formatter' );
pod_coverage_ok( 'LaTeX::TikZ::Functor' );
pod_coverage_ok( 'LaTeX::TikZ::Functor::Rule' );
pod_coverage_ok( 'LaTeX::TikZ::Formatter' );
pod_coverage_ok( 'LaTeX::TikZ::Functor' );
pod_coverage_ok( 'LaTeX::TikZ::Functor::Rule' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Color' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Fill' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Formatted' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Color' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Fill' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Formatted' );
-pod_coverage_ok( 'LaTeX::TikZ::Mod::Layer', $moose_private );
+pod_coverage_ok( 'LaTeX::TikZ::Mod::Layer', $mouse_private );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern::Dots' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern::Lines' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern::Dots' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Pattern::Lines' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Width' );
pod_coverage_ok( 'LaTeX::TikZ::Point' );
pod_coverage_ok( 'LaTeX::TikZ::Point::Math::Complex' );
pod_coverage_ok( 'LaTeX::TikZ::Mod::Width' );
pod_coverage_ok( 'LaTeX::TikZ::Point' );
pod_coverage_ok( 'LaTeX::TikZ::Point::Math::Complex' );
-pod_coverage_ok( 'LaTeX::TikZ::Scope', $moose_private );
+pod_coverage_ok( 'LaTeX::TikZ::Scope', $mouse_private );
pod_coverage_ok( 'LaTeX::TikZ::Set' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arc' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arrow' );
pod_coverage_ok( 'LaTeX::TikZ::Set' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arc' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arrow' );
-pod_coverage_ok( 'LaTeX::TikZ::Set::Chain', $moose_private );
+pod_coverage_ok( 'LaTeX::TikZ::Set::Chain', $mouse_private );
pod_coverage_ok( 'LaTeX::TikZ::Set::Circle' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Container' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Line' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Circle' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Container' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Line' );
-use Any::Moose 'Exporter';
-any_moose('Exporter')->setup_import_methods(
+Mouse::Exporter->setup_import_methods(
as_is => [ qw<using check is_point_ok> ],
);
as_is => [ qw<using check is_point_ok> ],
);
package LaTeX::TikZ::TestX::FromTestY;
package LaTeX::TikZ::TestX::FromTestY;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse::Util::TypeConstraints;
coerce 'LaTeX::TikZ::TestX::Autocoerce'
=> from 'LaTeX::TikZ::TestY'
coerce 'LaTeX::TikZ::TestX::Autocoerce'
=> from 'LaTeX::TikZ::TestY'