aboutsummaryrefslogtreecommitdiffstats
path: root/script/request-creation-graph
diff options
context:
space:
mode:
authorJames McKinney <james@slashpoundbang.com>2015-06-11 10:12:31 -0400
committerJames McKinney <james@slashpoundbang.com>2015-06-11 10:12:31 -0400
commit614cb2a9af6fbe593fea3e104e62210145cf7612 (patch)
tree062ce3315cae331e575987e98a00ea38454776e9 /script/request-creation-graph
parentb9ebcb7c223a2377d582589840ea8bb72cb5f654 (diff)
Eliminate TODO in shell scripts
Diffstat (limited to 'script/request-creation-graph')
-rwxr-xr-xscript/request-creation-graph6
1 files changed, 1 insertions, 5 deletions
diff --git a/script/request-creation-graph b/script/request-creation-graph
index f3baa2326..9b91e44b9 100755
--- a/script/request-creation-graph
+++ b/script/request-creation-graph
@@ -17,11 +17,7 @@ cd `dirname $0`
cd ../
source commonlib/shlib/deployfns
-# TODO: this is nasty :)
-OPTION_FOI_DB_HOST=`grep "host:" config/database.yml | head --lines=1 | cut -d ":" -f 2`
-OPTION_FOI_DB_PORT=`grep "port:" config/database.yml | head --lines=1 | cut -d ":" -f 2`
-OPTION_FOI_DB_NAME=`grep "database:" config/database.yml | head --lines=1 | cut -d ":" -f 2`
-OPTION_FOI_DB_USER=`grep "username:" config/database.yml | head --lines=1 | cut -d ":" -f 2`
+read OPTION_FOI_DB_HOST OPTION_FOI_DB_PORT OPTION_FOI_DB_NAME OPTION_FOI_DB_USER <<<$(ruby -r yaml -e 'db = YAML::load(STDIN.read); pr = db["production"]; puts pr["host"], pr["port"], pr["database"], pr["username"]' < config/database.yml)
SOURCEA=/tmp/foi-creation-rate-graph-data-$RANDOM$RANDOM
SOURCEB=/tmp/foi-creation-rate-graph-data-$RANDOM$RANDOM