modify belch and puke to operate as method calls
[dbsrgits/SQL-Abstract.git] / maint / lib / Chunkstrumenter.pm
CommitLineData
497e9bed 1package Chunkstrumenter;
2
3use strictures 2;
4use Class::Method::Modifiers qw(install_modifier);
5use Data::Dumper::Concise;
6use Context::Preserve;
7
8require SQL::Abstract;
9
10open my $log_fh, '>>', 'chunkstrumenter.log';
11
12install_modifier 'SQL::Abstract', around => '_order_by_chunks' => sub {
13 my ($orig, $self) = (shift, shift);
14 my @args = @_;
15 preserve_context { $self->$orig(@args) }
16 after => sub {
17 my $dumped = Dumper([ $self->{quote_char}, \@args, \@_ ]);
18 $dumped =~ s/\n\Z/,\n/;
19 print $log_fh $dumped;
20 };
21};
22
231;