lib/anyway_config.rb in anyway_config-2.0.0.pre2 vs lib/anyway_config.rb in anyway_config-2.0.0.rc1

- old
+ new

@@ -1,32 +1,38 @@ # frozen_string_literal: true -module Anyway # :nodoc: - require "anyway/version" +require "ruby-next" - require "anyway/config" - require "anyway/rails/config" if defined?(::Rails::VERSION) - require "anyway/env" +require "ruby-next/language/setup" +RubyNext::Language.setup_gem_load_path - # Use Settings name to not confuse with Config. - # - # Settings contain the library-wide configuration. - class Settings - class << self - # Define whether to load data from - # *.yml.local (or credentials/local.yml.enc) - attr_accessor :use_local_files - end +require "anyway/version" - # By default, use local files only in development (that's the purpose if the local files) - self.use_local_files = (ENV["RACK_ENV"] == "development" || ENV["RAILS_ENV"] == "development") - end +require "anyway/ext/deep_dup" +require "anyway/ext/deep_freeze" +require "anyway/ext/hash" +require "anyway/settings" +require "anyway/tracing" +require "anyway/config" +require "anyway/auto_cast" +require "anyway/env" +require "anyway/loaders" + +module Anyway # :nodoc: class << self def env @env ||= ::Anyway::Env.new end + + def loaders + @loaders ||= ::Anyway::Loaders::Registry.new + end end - require "anyway/railtie" if defined?(::Rails::VERSION) - require "anyway/testing" if ENV["RACK_ENV"] == "test" || ENV["RAILS_ENV"] == "test" + # Configure default loaders + loaders.append :yml, Loaders::YAML + loaders.append :env, Loaders::Env end + +require "anyway/rails" if defined?(::Rails::VERSION) +require "anyway/testing" if ENV["RACK_ENV"] == "test" || ENV["RAILS_ENV"] == "test"