summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-02-02 14:01:03 +0100
committerfranck cuny <franck@lumberjaph.net>2010-02-02 14:01:03 +0100
commit1a5a4b95449227cbad4bee3119ef706303fac728 (patch)
tree4dbe2a37f7e5c5c1c7291667b221fc020ac04433
parentno more limit (diff)
downloadgithub-explorer-1a5a4b95449227cbad4bee3119ef706303fac728.tar.gz
use a conf file for dbi
-rw-r--r--crawl.pl21
1 files changed, 12 insertions, 9 deletions
diff --git a/crawl.pl b/crawl.pl
index cbcfe6c..8b240be 100644
--- a/crawl.pl
+++ b/crawl.pl
@@ -4,23 +4,26 @@ use warnings;
use lib ('lib');
use githubexplorer;
use Getopt::Long;
+use YAML::Syck;
GetOptions(
'deploy' => \my $deploy,
'profiles' => \my $profiles,
'repo' => \my $repo,
- 'graph' => \my $graph,
+ 'graph' => \my $graph,
+ 'conf=s' => \my $conf,
);
+my $conf_data = LoadFile($conf);
+
my $gh = githubexplorer->new(
- seed => [qw/franckcuny/],
- api_token => $ENV{'GITHUB_APIKEY'},
- api_login => $ENV{'GITHUB_LOGIN'},
- with_repo => $repo,
- connect_info =>
- [ 'dbi:SQLite:dbname=test.sqlite', '', '', { AutoCommit => 1 } ],
+ seed => [qw/franckcuny/],
+ api_token => $ENV{'GITHUB_APIKEY'},
+ api_login => $ENV{'GITHUB_LOGIN'},
+ with_repo => $repo,
+ connect_info => $conf_data->{connect_info},
);
-$gh->deploy if $deploy;
+$gh->deploy if $deploy;
$gh->harvest_profiles if $profiles;
-$gh->gen_graph if $graph;
+$gh->gen_graph if $graph;