patgoley/configurate
Configurate is a package for building layered `Config` objects, which are essentially stacks of key-value collections.
Example
let config = Config(ProcessInfo.processInfo) // Searches environment variables
.include(UserDefaults.standard) // Searches a UserDefaults instance
.include(try! ConfigFile(url: URL("config.json"))) // Searches a JSON or Plist config file, must result in [String: Any]
.include(["key": "overrideValue"]) // Searches a [String: Any] Dictionary
let value: String? = config["someKey"] // Infers expected return typeThe key value collections included in the Config are searched in reverse order, so that values from one collection override values from previously added collections.
Installation
Swift Package Manager
import PackageDescription
let package = Package(
name: "MyPackage",
dependencies: [
.Package(url: "https://github.com/patgoley/Configurate.git", majorVersion: 2),
]
)Cocoapods
pod 'Configurate', '~> 2.0'License
Package Metadata
Repository: patgoley/configurate
Default branch: master
README: README.md