From 1c0e5ce52322071074824ea0fa89c4485decde3b Mon Sep 17 00:00:00 2001 From: Jay Pfaffman Date: Mon, 26 Sep 2016 15:03:42 -0700 Subject: [PATCH] bbpress.rb: move configuration to ENV --- script/import_scripts/bbpress.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/script/import_scripts/bbpress.rb b/script/import_scripts/bbpress.rb index 87ee57bdd14..bd5e872650b 100644 --- a/script/import_scripts/bbpress.rb +++ b/script/import_scripts/bbpress.rb @@ -1,18 +1,29 @@ require 'mysql2' require File.expand_path(File.dirname(__FILE__) + "/base.rb") + +# Before running this script, paste these lines into your shell, +# then use arrow keys to edit the values +=begin +export BBPRESS_USER="root" +export BBPRESS_DB="bbpress" +export BBPRESS_PW="" +=end + class ImportScripts::Bbpress < ImportScripts::Base BB_PRESS_DB ||= ENV['BBPRESS_DB'] || "bbpress" BATCH_SIZE ||= 1000 - + BB_PRESS_PW ||= ENV['BBPRESS_PW'] || "" + BB_PRESS_USER ||= ENV['BBPRESS_USER'] || "root" def initialize super @client = Mysql2::Client.new( host: "localhost", - username: "root", + username: BB_PRESS_USER, database: BB_PRESS_DB, + password: BB_PRESS_PW, ) end