From: Brian Phillips Date: Tue, 9 Feb 2010 19:34:01 +0000 (-0600) Subject: fix whitespace tabs ==> ' ' x 4 X-Git-Tag: 0.05002~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=25d38102c55dbe5dc3f9a2e67a4b7538546c7883;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix whitespace tabs ==> ' ' x 4 --- diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index 2a210fe..02d3f8e 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -143,43 +143,43 @@ sub loader_options { my $self = shift; my %args = (ref $_[0] eq 'HASH') ? %{$_[0]} : @_; - $self->_validate_loader_options(\%args); + $self->_validate_loader_options(\%args); $self->_loader_args(\%args); $self; } sub _validate_loader_options { - my $self = shift; - my $args = shift; - - my @class_keys = qw( - schema_base_class result_base_class additional_base_classes - left_base_classes additional_classes components resultset_components - ); - foreach my $k ( grep { exists $args->{$_} } @class_keys ) { - my @classes = ref( $args->{$k} ) eq 'ARRAY' ? @{ $args->{$k} } : $args->{$k}; - foreach my $c (@classes) { - - # components default to being under the DBIx::Class namespace unless they - # are preceeded with a '+' - if ( $k =~ m/components$/ && $c !~ s/^\+// ) { - $c = 'DBIx::Class::' . $c; - } - - # 1 == installed, 0 == not installed, undef == invalid classname - my $installed = Class::Inspector->installed($c); - if ( defined($installed) ) { - if ( $installed == 0 ) { - croak qq/$c, as specified in the loader option "$k", is not installed/; - } - } else { - croak qq/$c, as specified in the loader option "$k", is an invalid class name/; - } - } - } - - return; + my $self = shift; + my $args = shift; + + my @class_keys = qw( + schema_base_class result_base_class additional_base_classes + left_base_classes additional_classes components resultset_components + ); + foreach my $k ( grep { exists $args->{$_} } @class_keys ) { + my @classes = ref( $args->{$k} ) eq 'ARRAY' ? @{ $args->{$k} } : $args->{$k}; + foreach my $c (@classes) { + + # components default to being under the DBIx::Class namespace unless they + # are preceeded with a '+' + if ( $k =~ m/components$/ && $c !~ s/^\+// ) { + $c = 'DBIx::Class::' . $c; + } + + # 1 == installed, 0 == not installed, undef == invalid classname + my $installed = Class::Inspector->installed($c); + if ( defined($installed) ) { + if ( $installed == 0 ) { + croak qq/$c, as specified in the loader option "$k", is not installed/; + } + } else { + croak qq/$c, as specified in the loader option "$k", is an invalid class name/; + } + } + } + + return; } sub _invoke_loader { diff --git a/t/23dumpmore.t b/t/23dumpmore.t index c0da742..47dbfc5 100644 --- a/t/23dumpmore.t +++ b/t/23dumpmore.t @@ -373,13 +373,13 @@ do_dump_test( }, ); eval { - do_dump_test( - classname => 'DBICTest::DumpMore::1', - options => { - use_namespaces => 1, - result_base_class => 'My::MissingResultBaseClass', - }, - ); + do_dump_test( + classname => 'DBICTest::DumpMore::1', + options => { + use_namespaces => 1, + result_base_class => 'My::MissingResultBaseClass', + }, + ); }; ok($@, "exception thrown on bad result_base_class"); like($@, qr/My::MissingResultBaseClass.*is not installed/, "user-friend error message on missing result_base_class" );