Sha256: 9ff78f9c33e9a5775c065b4bbcd7d8f568d1040f7fbceaeb8ac1349b609f144e

Contents?: true

Size: 674 Bytes

Versions: 15

Compression:

Stored size: 674 Bytes

Contents

module Cirneco
  module Base
    # load ENV variables from .env file if it exists
    env_file = File.expand_path("../../../.env", __FILE__)
    if File.exist?(env_file)
      require 'dotenv'
      Dotenv.overload env_file
    end

    # load ENV variables from container environment if json file exists
    # see https://github.com/phusion/baseimage-docker#envvar_dumps
    env_json_file = "/etc/container_environment.json"
    if File.exist?(env_json_file)
      env_vars = JSON.parse(File.read(env_json_file))
      env_vars.each { |k, v| ENV[k] = v }
    end

    # default values for some ENV variables
    ENV['MDS_URL'] ||= "https://mds.test.datacite.org"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cirneco-0.9.27 lib/cirneco/base.rb
cirneco-0.9.26 lib/cirneco/base.rb
cirneco-0.9.25 lib/cirneco/base.rb
cirneco-0.9.24 lib/cirneco/base.rb
cirneco-0.9.23 lib/cirneco/base.rb
cirneco-0.9.22 lib/cirneco/base.rb
cirneco-0.9.21 lib/cirneco/base.rb
cirneco-0.9.20 lib/cirneco/base.rb
cirneco-0.9.19 lib/cirneco/base.rb
cirneco-0.9.18 lib/cirneco/base.rb
cirneco-0.9.17 lib/cirneco/base.rb
cirneco-0.9.16 lib/cirneco/base.rb
cirneco-0.9.15 lib/cirneco/base.rb
cirneco-0.9.14 lib/cirneco/base.rb
cirneco-0.9.13 lib/cirneco/base.rb