requires 'File::Slurp' => '9999.13';
requires 'List::MoreUtils' => 0;
requires 'namespace::clean' => 0;
-requires 'Data::Dumper::Concise' => '2.002';
requires 'Scope::Guard' => 0;
requires 'List::MoreUtils' => 0;
requires 'Exporter' => '5.63';
use File::Temp qw//;
use Class::Unload;
use Class::Inspector ();
-use Data::Dumper::Concise;
use Scalar::Util 'looks_like_number';
use File::Slurp 'slurp';
-use DBIx::Class::Schema::Loader::Utils 'split_name';
+use DBIx::Class::Schema::Loader::Utils qw/split_name dumper_squashed/;
use DBIx::Class::Schema::Loader::Optional::Dependencies ();
use Try::Tiny;
use DBIx::Class ();
$s = !defined $s ? 'undef' :
length($s) == 0 ? '(empty string)' :
ref($s) eq 'SCALAR' ? $$s :
- ref($s) ? do {
- my $dd = Dumper;
- $dd->Indent(0);
- $dd->Values([$s]);
- $dd->Dump;
- } :
+ ref($s) ? dumper_squashed $s :
looks_like_number($s) ? $s :
qq{'$s'}
;
use warnings;
use Exporter 'import';
-our @EXPORT_OK = qw/split_name/;
+our @EXPORT_OK = qw/split_name dumper dumper_squashed/;
use constant BY_CASE_TRANSITION =>
qr/(?<=[[:lower:]\d])[\W_]*(?=[[:upper:]])|[\W_]+/;
split $name =~ /[[:upper:]]/ && $name =~ /[[:lower:]]/ ? BY_CASE_TRANSITION : BY_NON_ALPHANUM, $name;
}
+# Stolen from Data::Dumper::Concise
+
+sub dumper($) {
+ my $val = shift;
+
+ my $dd = Data::Dumper->new([]);
+ $dd->Terse(1)->Indent(1)->Useqq(1)->Deparse(1)->Quotekeys(0)->Sortkeys(1);
+ return $dd->Values([ $val ])->Dump;
+}
+
+sub dumper_squashed($) {
+ my $val = shift;
+
+ my $dd = Data::Dumper->new([]);
+ $dd->Terse(1)->Indent(1)->Useqq(1)->Deparse(1)->Quotekeys(0)->Sortkeys(1)->Indent(0);
+ return $dd->Values([ $val ])->Dump;
+}
+
1;
# vim:et sts=4 sw=4 tw=0:
use Test::More;
use File::Path;
use IPC::Open3;
-use Data::Dumper::Concise;
+use DBIx::Class::Schema::Loader::Utils 'dumper_squashed';
use DBIx::Class::Schema::Loader ();
use DBIx::Class::Schema::Loader::Optional::Dependencies ();
use File::Temp 'tempfile';
my @cmd = ($^X, qw(./script/dbicdump));
while (my ($opt, $val) = each(%{ $tdata{options} })) {
- $val = Dumper($val) if ref $val;
+ $val = dumper_squashed $val if ref $val;
push @cmd, '-o', "$opt=$val";
}
use Digest::MD5;
use File::Find 'find';
use Class::Unload ();
-use Data::Dumper::Concise;
+use DBIx::Class::Schema::Loader::Utils 'dumper_squashed';
use List::MoreUtils 'apply';
use DBIx::Class::Schema::Loader::Optional::Dependencies ();
use namespace::clean;
my %info = %{ $rsrc->column_info($col_name) };
delete @info{qw/is_nullable timezone locale sequence/};
- my $text_col_def = do {
- my $dd = Dumper;
- $dd->Indent(0);
- $dd->Values([\%info]);
- $dd->Dump;
- };
-
- my $text_expected_info = do {
- my $dd = Dumper;
- $dd->Indent(0);
- $dd->Values([$expected_info]);
- $dd->Dump;
- };
+ my $text_col_def = dumper_squashed \%info;
+
+ my $text_expected_info = dumper_squashed $expected_info;
is_deeply \%info, $expected_info,
"test column $col_name has definition: $text_col_def expecting: $text_expected_info";