From b38a3842b7e86b69615e88ed9691f213570c07a0 Mon Sep 17 00:00:00 2001 From: bpmcdevitt Date: Sat, 6 Apr 2019 00:03:01 -0500 Subject: [PATCH] configuration example complete --- bin/console | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/console b/bin/console index 3828443..eb3beac 100755 --- a/bin/console +++ b/bin/console @@ -15,10 +15,16 @@ def rest_client_toggle_log(default=false) end end -# not working yet -config = Pastebinner::Configuration.new -pb = Pastebinner::ApiClient.new(config.api_key, config.api_username, config.api_password) -es = Pastebinner::ElasticSearchHelper.new(ENV['elastic_search_url'], 'pastes') +Pastebinner.configure do |config| + config.api_key = ENV['pastebin_api_key'] + config.api_username = ENV['pastebin_username'] + config.api_password = ENV['pastebin_password'] + config.elasticsearch_url = ENV['elasticsearch_url'] + config.redis_url = ENV['redis_url'] +end + +pb = Pastebinner::ApiClient.new(Pastebinner.configuration.api_key, Pastebinner.configuration.api_username, Pastebinner.configuration.api_password) +es = Pastebinner::ElasticSearchHelper.new(Pastebinner.configuration.elasticsearch_url, 'pastes') # sidekiq worker to send pastes to es paste_to_es_job = Pastebinner::PasteToEs.new