lib/anyway/rails/settings.rb in anyway_config-2.2.3 vs lib/anyway/rails/settings.rb in anyway_config-2.3.0
- old
+ new
@@ -7,21 +7,13 @@
rescue LoadError
end
module Anyway
class Settings
- class Future
- setting :unwrap_known_environments, true
- end
-
class << self
attr_reader :autoload_static_config_path, :autoloader
- attr_accessor :known_environments
- # Define a key for environmental yaml files to read default values from
- attr_accessor :default_environmental_key
-
if defined?(::Zeitwerk)
def autoload_static_config_path=(val)
raise "Cannot setup autoloader after application has been initialized" if ::Rails.application.initialized?
return unless ::Rails.root.join(val).exist?
@@ -59,9 +51,17 @@
end
def cleanup_autoload_paths
:no_op
end
+ end
+
+ def current_environment
+ ::Rails.env.to_s
+ end
+
+ def app_root
+ ::Rails.root
end
end
self.default_config_path = ->(name) { ::Rails.root.join("config", "#{name}.yml") }
self.known_environments = %w[test development production]