Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes RT#90922 Class::MOP::load_class deprecation warnings #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ requires:
Class::Data::Inheritable: 0
Class::Inspector: 0
Class::MOP: 0
Class::Load: 0.20
DBD::SQLite: 1.14
DBI: 1.4
Data::Dump: 0
Expand Down
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ requires 'DateTime::Format::SQLite';

requires 'Try::Tiny';
requires 'Class::MOP';
requires 'Class::Load' => 0.20;
requires 'Class::Inspector';
requires 'Class::Data::Inheritable';
requires 'Data::Page' => 2.00;
Expand Down
5 changes: 3 additions & 2 deletions lib/DBIx/ObjectMapper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ our $VERSION = '0.3018';

use Carp::Clan qw/^DBIx::ObjectMapper/;
use Params::Validate qw(:all);
use Class::Load;

use DBIx::ObjectMapper::Log;
use DBIx::ObjectMapper::Utils;
Expand Down Expand Up @@ -83,8 +84,8 @@ sub relation {
= $class
. '::Relation::'
. DBIx::ObjectMapper::Utils::camelize($rel_type);
Class::MOP::load_class($rel_class)
unless Class::MOP::is_class_loaded($rel_class);
Class::Load::load_class($rel_class)
unless Class::Load::is_class_loaded($rel_class);
return $rel_class->new( @_ );
}

Expand Down
6 changes: 3 additions & 3 deletions lib/DBIx/ObjectMapper/Mapper/Attribute.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;
use Carp::Clan qw/^DBIx::ObjectMapper/;
use Params::Validate qw(:all);
use Class::MOP;
use Class::Load;

sub new {
my $class = shift;
Expand Down Expand Up @@ -40,8 +40,8 @@ sub new {
}

my $attribute_class = $class . '::' . $type;
Class::MOP::load_class($attribute_class)
unless Class::MOP::is_class_loaded($attribute_class);
Class::Load::load_class($attribute_class)
unless Class::Load::is_class_loaded($attribute_class);
my $self = bless \%option, $attribute_class;
$self->init;

Expand Down
6 changes: 3 additions & 3 deletions lib/DBIx/ObjectMapper/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;
use Carp::Clan qw/^DBIx::ObjectMapper/;
use Try::Tiny;
use Class::MOP;
use Class::Load;
use Scalar::Util;
use Hash::Merge;
use Class::Inspector;
Expand All @@ -13,15 +13,15 @@ sub installed { Class::Inspector->installed($_[0]) }
sub load_class {
my $class_name = shift;
return $class_name if loaded($class_name);
Class::MOP::load_class($class_name);
Class::Load::load_class($class_name);
# confess(
# "require $class_name was successful but the package is not defined")
# unless loaded($class_name);

return $class_name;
}

sub loaded { Class::MOP::is_class_loaded($_[0]) }
sub loaded { Class::Load::is_class_loaded($_[0]) }

sub is_deeply {
my ( $X, $Y ) = @_;
Expand Down
4 changes: 2 additions & 2 deletions t/10_meta/000_column_type.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use strict;
use warnings;
use Test::More;
use Class::MOP;
use Class::Load;
use DBIx::ObjectMapper::Engine::DBI;
use DateTime::Format::SQLite;

Expand All @@ -12,7 +12,7 @@ $CHECK_BIT = 0 if $@;
sub build_pkg($) {
my $t = shift;
my $pkg = 'DBIx::ObjectMapper::Metadata::Table::Column::Type::' . $t;
Class::MOP::load_class($pkg);
Class::Load::load_class($pkg);
return $pkg;
}

Expand Down