From: Matt S Trout Date: Fri, 4 Oct 2019 01:36:40 +0000 (+0000) Subject: extraclauses and plugin system X-Git-Tag: v2.000000~3^2~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2cd68a50ae3e6945ae7a230b65627df9076847ec;p=dbsrgits%2FSQL-Abstract.git extraclauses and plugin system --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 26c0b46..a049130 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].')');