about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan "Duke" Leto <jonathan@leto.net>2011-04-29 19:29:33 -0700
committerJonathan "Duke" Leto <jonathan@leto.net>2011-04-29 19:29:33 -0700
commit7d4f2cd6db48e527f4822fe318ff4a82c064c645 (patch)
tree76cf70b85ec26c5d0eccbfdb956d51fdf34bda4c
parentMake the builder do a 'use lib lib' so we don't have to (diff)
downloadjitterbug-7d4f2cd6db48e527f4822fe318ff4a82c064c645.tar.gz
Make the command-line arg of the builder --config to match jitterbug_db
-rw-r--r--lib/jitterbug/Builder.pm10
-rw-r--r--t/005_builder.t4
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm
index 366878f..1f9bd3d 100644
--- a/lib/jitterbug/Builder.pm
+++ b/lib/jitterbug/Builder.pm
@@ -23,14 +23,14 @@ sub new {
 
     GetOptions(
         'C|cron'         => \$self->{'cron'},
-        'c|configfile=s' => \$self->{'configfile'},
+        'c|config=s' => \$self->{'config'},
         's|sleep=i'      => \$self->{'sleep'},
     ) or die "Cannot get options\n";
 
-    $self->{'configfile'}
+    $self->{'config'}
         or die qq{missing config.yml, use "-c config.yml" to help us find it\n};
 
-    die "Does not exist!: " . $self->{'configfile'} unless -e $self->{'configfile'};
+    die "Does not exist!: " . $self->{'config'} unless -e $self->{'config'};
 
     return $self;
 }
@@ -41,10 +41,10 @@ sub debug {
 
 sub run {
     my $self      = shift || die "Must call run() from object\n";
-    my $conf      = $self->{'conf'} = LoadFile( $self->{'configfile'} );
+    my $conf      = $self->{'conf'} = LoadFile( $self->{'config'} );
     my $dbix_conf = $conf->{'plugins'}{'DBIC'}{'schema'};
 
-    debug("Loaded config file: " . $self->{'configfile'});
+    debug("Loaded config file: " . $self->{'config'});
     debug("Connection Info: " . join ':', @{ $dbix_conf->{'connect_info'} });
 
     $self->{'schema'}   = jitterbug::Schema->connect( @{ $dbix_conf->{'connect_info'} } );
diff --git a/t/005_builder.t b/t/005_builder.t
index 3adf39f..cc0bb0a 100644
--- a/t/005_builder.t
+++ b/t/005_builder.t
@@ -17,7 +17,7 @@ jitterbug::Test->init();
     isa_ok($b,'jitterbug::Builder');
     can_ok($b,qw/run build run_task sleep/);
 
-    is($b->{'configfile'}, 't/data/test.yml');
+    is($b->{'config'}, 't/data/test.yml');
     is($b->{'cron'}, 1 );
 }
 
@@ -33,7 +33,7 @@ jitterbug::Test->init();
     local @ARGV = qw(-c t/data/test.yml -C);
     my $b = jitterbug::Builder->new();
     isa_ok($b, 'jitterbug::Builder');
-    is($b->{'configfile'}, 't/data/test.yml');
+    is($b->{'config'}, 't/data/test.yml');
 
     is($b->run, 0, '->run returns 0 in cron mode');