'Class::C3::Componentised' => '1.0009',
'Class::Inspector' => '1.24',
'Context::Preserve' => '0.01',
- 'Data::Dumper::Concise' => '2.020',
'Data::Page' => '2.00',
'Devel::GlobalDestruction' => '0.09',
'Hash::Merge' => '0.12',
use DBIx::Class::ResultClass::HashRefInflator;
use Scalar::Util qw/blessed weaken reftype/;
use DBIx::Class::_Util qw(
- dbic_internal_try
+ dbic_internal_try dump_value
fail_on_internal_wantarray fail_on_internal_call UNRESOLVABLE_CONDITION
);
use Try::Tiny;
return $rs;
}
-my $dark_sel_dumper;
sub _normalize_selection {
my ($self, $attrs) = @_;
else {
$attrs->{_dark_selector} = {
plus_stage => $pref,
- string => ($dark_sel_dumper ||= do {
- require Data::Dumper::Concise;
- Data::Dumper::Concise::DumperObject()->Indent(0);
- })->Values([$_])->Dump
- ,
+ string => do {
+ local $Data::Dumper::Indent = 0;
+ dump_value $_;
+ },
};
last SELECTOR;
}
use Try::Tiny;
use SQL::Abstract qw(is_plain_value is_literal_value);
use DBIx::Class::_Util qw(
- quote_sub perlstring serialize
+ quote_sub perlstring serialize dump_value
dbic_internal_try
detected_reinvoked_destructor scope_guard
mkdir_p
sub _warn_undetermined_driver {
my ($self, $msg) = @_;
- require Data::Dumper::Concise;
-
carp_once ($msg . ' While we will attempt to continue anyway, the results '
. 'are likely to be underwhelming. Please upgrade DBIC, and if this message '
. "does not go away, file a bugreport including the following info:\n"
- . Data::Dumper::Concise::Dumper($self->_describe_connection)
+ . dump_value $self->_describe_connection
);
}
$msg,
$cols->[$c_idx],
do {
- require Data::Dumper::Concise;
local $Data::Dumper::Maxdepth = 5;
- Data::Dumper::Concise::Dumper ({
+ dump_value {
map { $cols->[$_] =>
$data->[$r_idx][$_]
} 0..$#$cols
- }),
+ };
}
);
};
$self->throw_exception("Unexpected populate error: $err")
if ($i > $#$tuple_status);
- require Data::Dumper::Concise;
$self->throw_exception(sprintf "execute_for_fetch() aborted with '%s' at populate slice:\n%s",
($tuple_status->[$i][1] || $err),
- Data::Dumper::Concise::Dumper( { map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols) } ),
+ dump_value { map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols) },
);
}
use Scalar::Util qw/blessed weaken/;
use List::Util 'first';
use Sub::Name();
-use Data::Dumper::Concise 'Dumper';
use Try::Tiny;
use Context::Preserve 'preserve_context';
-use DBIx::Class::_Util qw( sigwarn_silencer dbic_internal_try );
+use DBIx::Class::_Util qw( sigwarn_silencer dbic_internal_try dump_value );
use namespace::clean;
__PACKAGE__->sql_limit_dialect ('GenericSubQ');
if (not $sth) {
$self->throw_exception(
"Could not find row in table '$table' for blob update:\n"
- . (Dumper \%where)
+ . dump_value \%where
);
}
use List::Util 'first';
use Scalar::Util 'blessed';
-use DBIx::Class::_Util qw(UNRESOLVABLE_CONDITION serialize);
+use DBIx::Class::_Util qw(UNRESOLVABLE_CONDITION serialize dump_value);
use SQL::Abstract qw(is_plain_value is_literal_value);
use DBIx::Class::Carp;
use namespace::clean;
( $_ = join ' ', map {
( ! defined $_ ) ? ()
- : ( length ref $_ ) ? (require Data::Dumper::Concise && $self->throw_exception(
- "Unexpected ref in scan-plan: " . Data::Dumper::Concise::Dumper($_)
- ))
+ : ( length ref $_ ) ? $self->throw_exception(
+ "Unexpected ref in scan-plan: " . dump_value $_
+ )
: ( $_ =~ /^\s*$/ ) ? ()
: $_
# extra sanity check
if (keys %$p > 1) {
- require Data::Dumper::Concise;
local $Data::Dumper::Deepcopy = 1;
$self->throw_exception(
"Internal error: unexpected collapse unroll:"
- . Data::Dumper::Concise::Dumper { in => { $lhs => $rhs }, out => $p }
+ . dump_value { in => { $lhs => $rhs }, out => $p }
);
}
refdesc refcount hrefaddr
scope_guard detected_reinvoked_destructor
is_exception dbic_internal_try
- quote_sub qsub perlstring serialize deep_clone
+ quote_sub qsub perlstring serialize deep_clone dump_value
parent_dir mkdir_p
UNRESOLVABLE_CONDITION
);
nfreeze($_[0]);
}
+my ($dd_obj, $dump_str);
+sub dump_value ($) {
+ local $Data::Dumper::Indent = 1
+ unless defined $Data::Dumper::Indent;
+
+ $dump_str = (
+ $dd_obj
+ ||=
+ do {
+ require Data::Dumper;
+ my $d = Data::Dumper->new([])
+ ->Purity(0)
+ ->Pad('')
+ ->Useqq(1)
+ ->Terse(1)
+ ->Freezer('')
+ ->Quotekeys(0)
+ ->Bless('bless')
+ ->Pair(' => ')
+ ->Sortkeys(1)
+ ->Deparse(1)
+ ;
+
+ $d->Sparseseen(1) if modver_gt_or_eq (
+ 'Data::Dumper', '2.136'
+ );
+
+ $d;
+ }
+ )->Values([$_[0]])->Dump;
+
+ $dd_obj->Reset->Values([]);
+
+ $dump_str;
+}
+
sub scope_guard (&) {
croak 'Calling scope_guard() in void context makes no sense'
if ! defined wantarray;
use SQL::Translator::Schema::Constants;
use SQL::Translator::Utils qw(header_comment);
-use Data::Dumper ();
+use DBIx::Class::_Util 'dump_value';
## Skip all column type translation, as we want to use whatever the parser got.
$output .= "\n__PACKAGE__->add_columns(";
foreach my $f (@fields)
{
- local $Data::Dumper::Terse = 1;
$output .= "\n '" . (keys %$f)[0] . "' => " ;
- my $colinfo =
- Data::Dumper->Dump([values %$f],
- [''] # keys %$f]
- );
- chomp($colinfo);
+ ( my $colinfo = dump_value( (values %$f)[0] ) ) =~ s/^/ /mg;
+ $colinfo =~ s/^\s*|\s*$//g;
$output .= $colinfo . ",";
}
$output .= "\n);\n";
foreach my $cont ($table->get_constraints)
{
-# print Data::Dumper::Dumper($cont->type);
if($cont->type =~ /foreign key/i)
{
# $output .= "\n__PACKAGE__->belongs_to('" .
my @known_modules = sort
{ ($load_weights->{$b}||0) <=> ($load_weights->{$a}||0) }
+ qw( Data::Dumper ),
keys %{
DBIx::Class::Optional::Dependencies->req_list_for([
grep
use warnings;
use Test::More;
-use Data::Dumper;
+use DBIx::Class::_Util 'dump_value';
use lib 't/cdbi/testlib';
use Film;
is $dir->nasties, 1, "We have one nasty";
ok $dir->delete;
- local $Data::Dumper::Terse = 1;
- ok +Film->retrieve("Alligator"), 'has_many with ' . Dumper ($args);;
+ ok +Film->retrieve("Alligator"), 'has_many with ' . dump_value $args;
$kk->delete;
}
use ANFANG;
use Carp;
use Scalar::Util qw(isweak weaken blessed reftype);
-use DBIx::Class::_Util qw(refcount hrefaddr refdesc);
+use DBIx::Class::_Util qw(refcount hrefaddr refdesc dump_value);
use DBICTest::RunMode;
-use Data::Dumper::Concise;
use DBICTest::Util qw( stacktrace visit_namespaces );
use constant {
CV_TRACING => !!(
ref($weak_registry->{$addr}{weakref}) eq 'CODE'
and
B::svref_2object($weak_registry->{$addr}{weakref})->XSUB
- ) ? '__XSUB__' : Dumper( $weak_registry->{$addr}{weakref} )
+ ) ? '__XSUB__' : dump_value $weak_registry->{$addr}{weakref}
;
};
use Test::More;
use DBICTest;
-
-use Data::Dumper;
-$Data::Dumper::Sortkeys = 1;
+use DBIx::Class::_Util 'dump_value';
my $schema = DBICTest->init_schema();
my $search = { 'artist.name' => 'Caterwauler McCrae' };
my $attr = { prefetch => [ qw/artist liner_notes/ ],
order_by => 'me.cdid' };
-my $search_str = Dumper($search);
-my $attr_str = Dumper($attr);
+my $search_str = dump_value $search;
+my $attr_str = dump_value $attr;
my $rs = $schema->resultset("CD")->search($search, $attr);
-is(Dumper($search), $search_str, 'Search hash untouched after search()');
-is(Dumper($attr), $attr_str, 'Attribute hash untouched after search()');
+is( dump_value $search, $search_str, 'Search hash untouched after search()');
+is( dump_value $attr, $attr_str, 'Attribute hash untouched after search()');
cmp_ok($rs + 0, '==', 3, 'Correct number of records returned');
use Test::More;
+use DBIx::Class::_Util 'dump_value';
use DBICTest ':DiffSQL';
use SQL::Abstract qw(is_plain_value is_literal_value);
use List::Util 'shuffle';
-use Data::Dumper;
-$Data::Dumper::Terse = 1;
-$Data::Dumper::Useqq = 1;
$Data::Dumper::Indent = 0;
my $schema = DBICTest->init_schema();
year $c->{sql}
)",
\@bind,
- 'Double condition correctly collapsed for steps' . Dumper \@query_steps,
+ 'Double condition correctly collapsed for steps' . dump_value \@query_steps,
);
}
use DBICTest ':DiffSQL';
-use DBIx::Class::_Util 'UNRESOLVABLE_CONDITION';
+use DBIx::Class::_Util qw( UNRESOLVABLE_CONDITION dump_value );
-use Data::Dumper;
BEGIN {
if ( eval { require Test::Differences } ) {
no warnings 'redefine';
) {
die unless Test::Builder->new->is_passing;
- my $name = do { local ($Data::Dumper::Indent, $Data::Dumper::Terse, $Data::Dumper::Sortkeys) = (0, 1, 1); Dumper $w };
+ my $name = do { local $Data::Dumper::Indent = 0; dump_value $w };
my ($collapsed_cond, $collapsed_cond_as_sql);
use Test::More;
use Test::Exception;
-use Data::Dumper::Concise;
+use DBIx::Class::_Util 'dump_value';
use DBICTest ':DiffSQL';
use DBIx::Class::SQLMaker::Oracle;
sub {
( $stmt, @bind ) = $sqla_oracle->_recurse_where( $case->{connect_by} );
is_same_sql_bind( $stmt, \@bind, $case->{stmt}, $case->{bind},$msg )
- || diag "Search term:\n" . Dumper $case->{connect_by};
+ || diag "Search term:\n" . dump_value $case->{connect_by};
}
,sprintf("lives is ok from '%s'",$msg));
}
use Test::More;
use Test::Exception;
-use Data::Dumper::Concise;
+use DBIx::Class::_Util 'dump_value';
use DBICTest ':DiffSQL';
sub test_order {
? map { [ { dbic_colname => $_->[0] } => $_->[1] ] } @{ $args->{bind} }
: ()
],
- ) || diag Dumper $args->{order_by};
+ ) || diag dump_value $args->{order_by};
};
}
use Test::Exception;
use DBICTest;
-use Data::Dumper;
+use DBIx::Class::_Util 'dump_value';
my $schema = DBICTest->init_schema( sqlite_use_file => 1 );
# we can not use a cloner portably because of the coderef
# so compare dumps instead
- local $Data::Dumper::Sortkeys = 1;
- my $arg_dump = Dumper ($invocations->{$type}{args});
+ my $arg_dump = dump_value $invocations->{$type}{args};
warnings_exist (
sub { $storage->connect_info ($invocations->{$type}{args}) },
'Warned about ignored attributes',
);
- is ($arg_dump, Dumper ($invocations->{$type}{args}), "$type didn't modify passed arguments");
+ is (
+ $arg_dump,
+ dump_value $invocations->{$type}{args},
+ "$type didn't modify passed arguments",
+ );
is_deeply ($storage->_dbi_connect_info, $invocations->{$type}{dbi_connect_info}, "$type produced correct _dbi_connect_info");
ok ( (not $storage->auto_savepoint and not $storage->unsafe), "$type correctly ignored extra hashref");
package DBICTest::Legacy::Storage;
use base 'DBIx::Class::Storage::DBI::SQLite';
- use Data::Dumper::Concise;
-
sub source_bind_attributes { return {} }
}
use strict;
use warnings;
use Test::More;
-use Data::Dumper::Concise;
use Try::Tiny;
use DBICTest;
+use DBIx::Class::_Util 'dump_value';
+$Data::Dumper::Indent = 0;
my %expected = (
'DBIx::Class::Storage::DBI' =>
my ($quote_char, $name_sep) = @$mapping{qw/quote_char name_sep/};
my $instance = $class->new;
- my $quote_char_text = dumper($quote_char);
+ my $quote_char_text = dump_value $quote_char;
if (exists $mapping->{quote_char}) {
is_deeply $instance->sql_quote_char, $quote_char,
my ($exp_quote_char, $exp_name_sep) =
@{$expected{$dbs{$db}}}{qw/quote_char name_sep/};
- my ($quote_char_text, $name_sep_text) = map { dumper($_) }
+ my ($quote_char_text, $name_sep_text) = map { dump_value $_ }
($exp_quote_char, $exp_name_sep);
is_deeply $sql_maker->quote_char,
}
done_testing;
-
-sub dumper {
- my $val = shift;
-
- my $dd = DumperObject;
- $dd->Indent(0);
- return $dd->Values([ $val ])->Dump;
-}
-
-1;