From: Matt S Trout Date: Fri, 4 Oct 2019 01:36:40 +0000 (+0000) Subject: extraclauses and plugin system X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=203af7d68ff6896e3196e3f072caf65b33dfd719;p=scpubgit%2FQ-Branch.git extraclauses and plugin system --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6389394..4ba4b76 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -334,6 +334,7 @@ sub plugin { require(join('/', split '::', $plugin).'.pm'); } $plugin->apply_to($self, @args); + return $self; } BEGIN { diff --git a/maint/sqlacexpr b/maint/sqlacexpr index e10d98d..9bcb6c6 100755 --- a/maint/sqlacexpr +++ b/maint/sqlacexpr @@ -3,7 +3,6 @@ use lib 'lib'; use strictures 2; use SQL::Abstract; -use SQL::Abstract::ExtraClauses; use Devel::DDCWarn; warn $ARGV[1]."\n"; @@ -11,9 +10,7 @@ warn $ARGV[1]."\n"; my $sqlac = SQL::Abstract->new( unknown_unop_always_func => 1, lazy_join_sql_parts => 1, -); - -SQL::Abstract::ExtraClauses->apply_to($sqlac); +)->plugin('+ExtraClauses'); my @args = ($ARGV[1] =~ /^\.\// ? do $ARGV[1] : eval '+('.$ARGV[1].')');