Changeset 163
- Timestamp:
- 07/19/10 14:41:27 (7 weeks ago)
- Files:
-
- 1 modified
-
trunk/lib/whatbot.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/whatbot.pm
r162 r163 28 28 has 'last_message' => ( is => 'rw', isa => 'whatbot::Message' ); 29 29 30 method config ( Str $basedir, Str $config_path ) {30 method config ( Str $basedir, Str $config_path? ) { 31 31 32 32 # Find configuration file 33 33 unless ($config_path and -e $config_path) { 34 34 my @try_config = ( 35 $basedir . '/conf/whatbot.conf', 35 '~/.whatbot/whatbot.conf', 36 '/usr/local/etc/whatbot/whatbot.conf', 37 '/usr/local/etc/whatbot.conf', 36 38 '/etc/whatbot/whatbot.conf', 37 39 '/etc/whatbot.conf', 38 '/usr/local/etc/whatbot/whatbot.conf', 39 '/usr/local/etc/whatbot.conf' 40 $basedir . '/conf/whatbot.conf', 40 41 ); 41 42 foreach (@try_config) { 42 $config_path = $_ if (-e $_); 43 if (-e $_) { 44 $config_path = $_; 45 last; 46 } 43 47 } 44 48 unless ($config_path and -e $config_path) { … … 135 139 $store->connect(); 136 140 $self->report_error('Configured store failed to load properly') 137 unless ( defined$store and defined $store->handle );141 unless ( $store and defined $store->handle ); 138 142 $base_component->store($store); 139 143 … … 149 153 foreach my $io_module ( @{$self->initial_config->io} ) { 150 154 $log->error('No interface designated for one or more IO modules') 151 unless ( defined$io_module->{'interface'} );155 unless ( $io_module->{'interface'} ); 152 156 153 157 my $io_class = 'whatbot::IO::' . $io_module->{'interface'}; … … 159 163 ); 160 164 $self->report_error('IO interface "' . $io_module->{'interface'} . '" failed to load properly') 161 unless ( defined $io_object);165 unless ($io_object); 162 166 163 167 $ios{ $io_object->name } = $io_object; 164 push( @io, $io_object);168 push( @io, $io_object ); 165 169 } 166 170 $base_component->ios(\%ios); … … 178 182 $log->write('Sending connect to ' . ref($io_object)); 179 183 $io_object->controller($controller); 180 $io_object->connect ;184 $io_object->connect(); 181 185 } 182 186