Sha256: c5d34c88990eb18af8a92a583b523b638f38d92cf978f0101b435c9cbf54a358

Contents?: true

Size: 568 Bytes

Versions: 4

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

require 'rails/railtie'

module GetaroundUtils; end

module GetaroundUtils::Railties; end

class GetaroundUtils::Railties::Dotenv < Rails::Railtie
  def load
    if ENV['DOTENVS'].present?
      overrides = ENV['DOTENVS'].split(',').map{ |n| [".env.#{n}.local", ".env.#{n}"] }.flatten
      warn('=' * 100)
      warn("⚠️  ENV is overriden with the following profiles: #{overrides}")
      warn('=' * 100)
      Dotenv.load(*overrides)
    end
    Dotenv::Railtie.load
    Dotenv.load('.env.all.local', '.env.all')
    nil
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
getaround_utils-0.2.29 lib/getaround_utils/railties/dotenv.rb
getaround_utils-0.2.28 lib/getaround_utils/railties/dotenv.rb
getaround_utils-0.2.27 lib/getaround_utils/railties/dotenv.rb
getaround_utils-0.2.26 lib/getaround_utils/railties/dotenv.rb