Rename init to dbinit and export it
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 18 Jun 2015 17:07:38 +0000 (20:07 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 18 Jun 2015 17:07:38 +0000 (20:07 +0300)
lib/Gruntmaster/App.pm
lib/Gruntmaster/Data.pm
t/Gruntmaster-Data.t
t/tools.t

index f61d145fad0347162455ee8da0e32793bf154d39..f2069284c6b5f53738540a3bdefdb14629be06cf 100644 (file)
@@ -21,7 +21,7 @@ sub global_opt_spec {
 
 sub table { shift->global_options->{table} }
 
-Gruntmaster::Data::init $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:';
+dbinit $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:';
 
 1;
 __END__
index 1558e46f413a12fe909fd516166c36aed522006b..bcc0085580c5fdb6d6ea2a0ce769604ec59d3a0e 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 
 use parent qw/Exporter/;
 our $VERSION = '5999.000_013';
-our @EXPORT = qw/purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
+our @EXPORT = qw/dbinit purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
 
 use JSON::MaybeXS qw/decode_json/;
 use HTTP::Tiny;
@@ -42,7 +42,7 @@ my %statements = (
 our $db;
 sub db () { $db }
 
-sub init {
+sub dbinit {
        $db = DBIx::Simple->new(@_);
        $db->keep_statements = 100;
 };
index 6d381eaecde541ee6ee188c376724f985690717b..ff3970190b72cc14dd58d99708257a8b184c4c81 100644 (file)
@@ -8,7 +8,7 @@ use Test::More;
 
 BEGIN {
        eval {
-               Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
+               dbinit 'dbi:Pg:dbname=gmtest'; 1;
        } or plan skip_all => 'Cannot connect to test database. Create it by running createdb gmtest before running this test. '. "Error: $@";
        plan tests => 33;
 }
index f871ad07c39a7a221c7062a33b0ed85dbdd4b699..59ed75523249d233288df11092ad5b0f6b9f6ab6 100644 (file)
--- a/t/tools.t
+++ b/t/tools.t
@@ -8,7 +8,7 @@ use App::Cmd::Tester;
 
 BEGIN {
        eval {
-               Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
+               dbinit 'dbi:Pg:dbname=gmtest'; 1;
        } or plan skip_all => 'Cannot connect to test database. Create it by running make_test_db.sh before running this test. '. "Error: $@";
        plan tests => 30;
 }
This page took 0.014192 seconds and 4 git commands to generate.