From 3286a180532a1d999072f8566e3a9e13e6439c8f Mon Sep 17 00:00:00 2001 From: nodkz Date: Wed, 19 Nov 2014 22:04:51 +0600 Subject: [PATCH 1/3] Disable dotenv file via ENV[YARP_DISABLE_DOTENV]=1 if you provide all env variables via bash --- README.md | 8 ++++++++ config.ru | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1454b33..0cc1462 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,14 @@ Thake a long look at the [`.env`](.env) file, as most configuration options for Yarp are there. +### Disable dotenv file + +For this you need use additional ENV variable `YARP_DISABLE_DOTENV=1` +You can provide ENV variables via bash from any file. +For example: + $ export $(cat /any_path/.rbenv-vars | xargs) && export YARP_DISABLE_DOTENV=1 && bundle exec rainbows -c rainbows.rb + + ### License Yarp is released under the MIT licence. diff --git a/config.ru b/config.ru index 7d516a1..159013e 100644 --- a/config.ru +++ b/config.ru @@ -1,8 +1,10 @@ lib = File.expand_path('../', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'dotenv' -Dotenv.load! +if ENV['YARP_DISABLE_DOTENV'].empty? + require 'dotenv' + Dotenv.load! +end require 'yarp/app' require 'yarp/initializers/new_relic' From 8136d7eed53c21850b38d7cea719c61949a5b618 Mon Sep 17 00:00:00 2001 From: nodkz Date: Wed, 19 Nov 2014 22:07:09 +0600 Subject: [PATCH 2/3] Disable dotenv file via ENV[YARP_DISABLE_DOTENV]=1 if you provide all env variables via bash --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0cc1462..0bf5bfa 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,10 @@ configuration options for Yarp are there. ### Disable dotenv file -For this you need use additional ENV variable `YARP_DISABLE_DOTENV=1` -You can provide ENV variables via bash from any file. -For example: - $ export $(cat /any_path/.rbenv-vars | xargs) && export YARP_DISABLE_DOTENV=1 && bundle exec rainbows -c rainbows.rb +For this you need use additional ENV variable `YARP_DISABLE_DOTENV=1`. +You can provide ENV variables via bash from any file, for example: + + $ export $(cat /any_path/.rbenv-vars | xargs) && export YARP_DISABLE_DOTENV=1 && bundle exec rainbows -c rainbows.rb ### License From 93b51989b373f1a6b0f2ec585c59c499892fc57d Mon Sep 17 00:00:00 2001 From: nodkz Date: Wed, 19 Nov 2014 22:26:38 +0600 Subject: [PATCH 3/3] Disable dotenv file via ENV[YARP_DISABLE_DOTENV]=1 if you provide all env variables via bash --- config.ru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.ru b/config.ru index 159013e..014e293 100644 --- a/config.ru +++ b/config.ru @@ -1,7 +1,7 @@ lib = File.expand_path('../', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -if ENV['YARP_DISABLE_DOTENV'].empty? +if ENV['YARP_DISABLE_DOTENV'].nil? require 'dotenv' Dotenv.load! end