From f854812fbc47279e032394a1ef785d1783682f9b Mon Sep 17 00:00:00 2001 From: pvincent Date: Sat, 22 Jun 2024 15:09:35 +0400 Subject: [PATCH] hotenv --- lib/hot_constants/live_constants.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/hot_constants/live_constants.rb b/lib/hot_constants/live_constants.rb index bbb514f..2739544 100644 --- a/lib/hot_constants/live_constants.rb +++ b/lib/hot_constants/live_constants.rb @@ -1,18 +1,19 @@ require 'dotenv' -# Development Constants +# Hot Live Constants module LiveConstants - HOT = {} # rubocop:disable Style/MutableConstant + HOTENV = {} # rubocop:disable Style/MutableConstant LOGGER = SemanticLogger[to_s] class << self def stimulus_debug = load_boolean('STIMULUS_DEBUG', false) def log_active_record = load_boolean('LOG_ACTIVE_RECORD', true) def log_action_view = load_boolean('LOG_ACTION_VIEW', true) - def load_boolean(key, default) = HOT.fetch(key, default).to_s.downcase == 'true' + + def load_boolean(key, default) = HOTENV.fetch(key, default).to_s.downcase == 'true' def reload! - HOT.replace Dotenv.parse + HOTENV.replace Dotenv.parse # LOGGER.warn 'reloaded!' ActiveRecord::Base.logger.level = log_active_record ? :debug : :fatal