Sha256: 96923246e45ee611af420f5036f86dc61bfefdcb5946590718fd0b9301fbda7e

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

require "pliny/config_helpers"

# Access all config keys like the following:
#
#     Config.database_url
#
# Each accessor corresponds directly to an ENV key, which has the same name
# except upcased, i.e. `DATABASE_URL`.
module Config
  extend Pliny::CastingConfigHelpers

  # Mandatory -- exception is raised for these variables when missing.
  mandatory :database_url, string

  # Optional -- value is returned or `nil` if it wasn't present.
  optional :app_name,            string
  optional :versioning_default,  string
  optional :versioning_app_name, string

  # Override -- value is returned or the set default.
  override :database_timeout, 10,           int
  override :db_pool,          5,            int
  override :deployment,       'production', string
  override :force_ssl,        true,         bool
  override :app_env,          'production', string
  override :port,             5000,         int
  override :pretty_json,      false,        bool
  override :puma_max_threads, 16,           int
  override :puma_min_threads, 1,            int
  override :puma_workers,     3,            int
  override :raise_errors,     false,        bool
  override :root,             File.expand_path("../../", __FILE__), string
  override :timeout,          10,           int
  override :versioning,       false,        bool
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pliny-0.21.0 lib/template/config/config.rb
pliny-0.20.2 lib/template/config/config.rb
pliny-0.20.1 lib/template/config/config.rb
pliny-0.20.0 lib/template/config/config.rb