Module: WolfCore::Integrations::EnvironmentOperations

Defined in:
lib/wolf_core/application/integrations/environment_operations.rb

Instance Method Summary collapse

Instance Method Details

#load_environment_variables(json_file) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/wolf_core/application/integrations/environment_operations.rb', line 4

def load_environment_variables(json_file)
  file_content = File.read(json_file)
  data = JSON.parse(file_content)
  data.each do |key, value|
    parsed_key = key.gsub(/([a-z])([A-Z])/, '\1_\2').upcase
    ENV[parsed_key] = value
  end
end