Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Disable dotenv file #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions config.ru
Original file line number Diff line number Diff line change
@@ -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'].nil?
require 'dotenv'
Dotenv.load!
end

require 'yarp/app'
require 'yarp/initializers/new_relic'
Expand Down