Sha256: 337fedc4fbd8195727eec2c7720b99f41f6707531059fade52b73957df621392

Contents?: true

Size: 907 Bytes

Versions: 8

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

module Anyway
  # 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

      # Return a path to YML config file given the config name
      attr_accessor :default_config_path

      # Enable source tracing
      attr_accessor :tracing_enabled
    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")

    # By default, consider configs are stored in the ./config folder
    self.default_config_path = ->(name) { "./config/#{name}.yml" }

    # Tracing is enabled by default
    self.tracing_enabled = true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
anyway_config-2.0.6 lib/anyway/settings.rb
anyway_config-2.0.5 lib/anyway/settings.rb
anyway_config-2.0.4 lib/anyway/settings.rb
anyway_config-2.0.3 lib/anyway/settings.rb
anyway_config-2.0.2 lib/anyway/settings.rb
anyway_config-2.0.1 lib/anyway/settings.rb
anyway_config-2.0.0 lib/anyway/settings.rb
anyway_config-2.0.0.rc1 lib/anyway/settings.rb