Sha256: 71564ec240d3df4ce7f30fc0111e822090eaeaaa202aca3ca34f18b86c7ed16b

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

# frozen_string_literal: true

module Anyway # :nodoc:
  require "anyway/version"

  require "anyway/config"
  require "anyway/rails/config" if defined?(::Rails::VERSION)
  require "anyway/env"

  # 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

    # 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

  class << self
    def env
      @env ||= ::Anyway::Env.new
    end
  end

  require "anyway/railtie" if defined?(::Rails::VERSION)
  require "anyway/testing" if ENV["RACK_ENV"] == "test" || ENV["RAILS_ENV"] == "test"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
anyway_config-2.0.0.pre2 lib/anyway_config.rb
anyway_config-2.0.0.pre lib/anyway.rb