Permalink
Browse files

Address Perl::Criitc issues

  • Loading branch information...
1 parent 57db08a commit 037e6a8eeb976844d2c381e269bcd34b5a7d48ab Ray Miller committed Aug 1, 2012
Showing with 12 additions and 7 deletions.
  1. +3 −2 lib/LIMS2/Task.pm
  2. +6 −4 lib/LIMS2/Task/YAMLDataLoader.pm
  3. +3 −1 lib/LIMS2/Tasks.pm
View
@@ -62,7 +62,7 @@ has schema => (
sub _build_schema {
my $self = shift;
- LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
+ return LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
}
has model => (
@@ -75,7 +75,7 @@ has model => (
sub _build_model {
my $self = shift;
require LIMS2::Model;
- LIMS2::Model->new( schema => $self->schema );
+ return LIMS2::Model->new( schema => $self->schema );
}
has ensembl_util => (
@@ -101,6 +101,7 @@ sub BUILD {
: $WARN;
Log::Log4perl->easy_init( { level => $log_level, layout => $self->log_layout } );
+ return;
}
override command_names => sub {
@@ -52,7 +52,7 @@ sub execute {
$self->log->info( "Running " . $self->abstract );
my ( $total_seen, $total_skipped, $total_err ) = (0,0,0);
-
+
for my $input_file ( @{$args} ) {
my ( $file_seen, $file_skipped, $file_err ) = $self->load_data_from_file( $input_file );
$total_seen += $file_seen;
@@ -61,23 +61,25 @@ sub execute {
}
$self->log->info( "Processed $total_seen records (skipped $total_skipped, failed $total_err)" );
+
+ return;
}
sub load_data_from_file {
my ( $self, $input_file ) = @_;
-
+
$self->log->info( "Loading data from $input_file" );
my ($file_seen, $file_skipped, $file_err) = (0,0,0);
my $it = iyaml( $input_file );
while ( my $datum = $it->next ) {
$file_seen++;
if ( ! $self->wanted( $datum ) ) {
$file_skipped++;
- next;
+ next;
}
try {
$self->model->txn_do(
- sub {
+ sub {
$self->create( $datum );
unless ( $self->commit ) {
$self->model->txn_rollback;
View
@@ -8,7 +8,9 @@ use namespace::autoclean;
extends 'MooseX::App::Cmd';
-use constant plugin_search_path => [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
+sub plugin_search_path {
+ return [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
+}
__PACKAGE__->meta->make_immutable;

0 comments on commit 037e6a8

Please sign in to comment.