From dfb9215b1b643a9a4513ffd87726b976907ae813 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Fri, 27 Oct 2017 11:43:16 +0200 Subject: [PATCH] TT#23775 do not load TryCatch since it's not used in the codebase of NGCP::Schema and it has Moose as a dependency. With this change, Moose will not be loaded as a dependency of NGCP::Schema at all. Change-Id: I01cb68486395e68fc1519b61ff86f5972bd283f8 --- lib/NGCP/Schema.pm | 2 +- lib/NGCP/Schema/Config.pm | 2 +- lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm | 2 +- lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm | 2 +- lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm | 2 +- lib/NGCP/Schema/ResultSet.pm | 2 +- t/compile.t | 5 ++--- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/NGCP/Schema.pm b/lib/NGCP/Schema.pm index 77e63c93..0eadcb83 100644 --- a/lib/NGCP/Schema.pm +++ b/lib/NGCP/Schema.pm @@ -1,6 +1,6 @@ package NGCP::Schema; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use NGCP::Schema::Config qw(); use Regexp::Common qw(net); use Regexp::IPv6 qw($IPv6_re); diff --git a/lib/NGCP/Schema/Config.pm b/lib/NGCP/Schema/Config.pm index 00b2032e..50f0d7b3 100644 --- a/lib/NGCP/Schema/Config.pm +++ b/lib/NGCP/Schema/Config.pm @@ -1,6 +1,6 @@ package NGCP::Schema::Config; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use XML::Simple qw(); my $_config; diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm index 49d1d95c..6433b7d7 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm @@ -1,5 +1,5 @@ package NGCP::Schema::InflateColumn::DateTime::EpochMicro; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use DateTime qw(); use base 'DBIx::Class'; diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm index b981bf97..4a6169f8 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm @@ -1,5 +1,5 @@ package NGCP::Schema::InflateColumn::DateTime::EpochMilli; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use DateTime qw(); use base 'DBIx::Class'; diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm index c8724b82..bf022150 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm @@ -1,5 +1,5 @@ package NGCP::Schema::InflateColumn::DateTime::EpochString; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use DateTime qw(); use base 'DBIx::Class'; diff --git a/lib/NGCP/Schema/ResultSet.pm b/lib/NGCP/Schema/ResultSet.pm index 043b49b4..f980d67e 100644 --- a/lib/NGCP/Schema/ResultSet.pm +++ b/lib/NGCP/Schema/ResultSet.pm @@ -1,5 +1,5 @@ package NGCP::Schema::ResultSet; -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use base 'DBIx::Class::ResultSet'; our $VERSION = '2.007'; diff --git a/t/compile.t b/t/compile.t index 3163eda6..71f88385 100644 --- a/t/compile.t +++ b/t/compile.t @@ -1,4 +1,4 @@ -use Sipwise::Base; +use Sipwise::Base '-skip'=>['TryCatch']; use blib 'blib'; use File::ShareDir qw(dist_file); use Module::Runtime qw(use_module); @@ -6,9 +6,8 @@ use Test::Fatal qw(exception); use Test::More import => [qw(done_testing ok)]; my $config_location = dist_file('NGCP-Schema', 'test.conf'); -ok use_module('NGCP::Schema::Config')->instance->config_file($config_location), 'config'; ok(my $class = use_module('NGCP::Schema'), 'load schema'); -ok(my $schema = $class->connect, 'connect'); +ok(my $schema = $class->connection({config_file => $config_location}), 'connect'); for my $source (sort $schema->sources) { ok(!exception { $schema->resultset($source)->first }, "select $source"); }