3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/metrifox_sdk/util_methods.rb', line 3
def self.load_dotenv
return if @dotenv_loaded
env_files = ['.env.local', '.env']
env_files.each do |file|
next unless File.exist?(file)
File.readlines(file).each do |line|
line = line.strip
next if line.empty? || line.start_with?('#')
key, value = line.split('=', 2)
next unless key && value
value = value.gsub(/\A['"]|['"]\z/, '')
ENV[key] ||= value
end
break end
@dotenv_loaded = true
end
|