Latest 2.0
Homepage https://github.com/patgoley/Configurate
License MIT
Platforms ios 8.0
Authors

[CocoaPods]() [CocoaPods]() [Travis]() [codecov]()

Configurate is a package for building layered Config objects, which are essentially stacks of key-value collections.
Configs are protocol based, so they can be implemented by any source that can provide a value for a given key.

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 type

The 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

MIT

Latest podspec

{
    "name": "Configurate",
    "version": "2.0",
    "summary": "An abstract, cross-platform configuration library for Swift applications.",
    "description": "Configurate provides a common interface for configuration type objects (e.g. UserDefaults, [String: Any], etc).nIt also provides a builder pattern for composing configurations into a single Config object.",
    "homepage": "https://github.com/patgoley/Configurate",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Patrick Goley": "[email protected]"
    },
    "source": {
        "git": "https://github.com/patgoley/Configurate.git",
        "tag": "2.0"
    },
    "social_media_url": "https://twitter.com/bitsbetweenbits",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Sources/Configurate/**/*"
}

Pin It on Pinterest

Share This