diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..6980ef9 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to IBM-Swift + +We welcome contributions, and request you follow these guidelines. + + - [Raising issues](#raising-issues) + - [Contributor License Agreement](#contributor-license-agreement) + - [Coding Standards](#coding-standards) + + +## Raising issues + +Please raise any bug reports on the issue tracker. Be sure to +search the list to see if your issue has already been raised. + +A good bug report is one that make it easy for us to understand what you were +trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue. + +### Contributor License Agreement + +In order for us to accept pull-requests, the contributor must first complete +a Contributor License Agreement (CLA). Please see our [CLA repo](http://github.com/IBM-Swift/CLA) for more information. + +This clarifies the intellectual property license granted with any contribution. It is for your protection as a +Contributor as well as the protection of IBM and its customers; it does not +change your rights to use your own Contributions for any other purpose. + +### Coding standards + +Please ensure you follow [the Kitura coding standards](https://github.com/IBM-Swift/Kitura/blob/master/Documentation/CodeConventions.md) + +Please note: + + - all files must have the Apache license in the header. + - all PRs must have passing builds for all operating systems. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d1763d7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ + + +## Description + + +## Motivation and Context + + + +## How Has This Been Tested? + + + + +## Checklist: + + +- [ ] I have submitted a [CLA form](https://github.com/IBM-Swift/CLA) +- [ ] If applicable, I have updated the documentation accordingly. +- [ ] If applicable, I have added tests to cover my changes. diff --git a/Package.swift b/Package.swift index 47d2ec5..97ebc4e 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ import PackageDescription let package = Package( name: "Configuration", targets: [ - Target(name: "TestProgram", dependencies: [ .Target(name: "Configuration") ]) + Target(name: "ConfigurationTestExecutable", dependencies: [.Target(name: "Configuration")]) ], dependencies: [ .Package(url: "https://github.com/IBM-Swift/LoggerAPI.git", majorVersion: 1) diff --git a/README.md b/README.md index c943c9f..b5697f8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Configuration -[![Build Status - Master](https://api.travis-ci.org/IBM-Swift/Configuration.svg?branch=master)](https://travis-ci.org/IBM-Swift/Configuration) +[![Build Status](https://api.travis-ci.org/IBM-Swift/Configuration.svg?branch=master)](https://travis-ci.org/IBM-Swift/Configuration) ![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat) ![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat) ![Apache 2](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat) @@ -34,13 +34,13 @@ manager.load(file: "config.json").load(.environmentVariables) let value = manager["path:to:configuration:value"] ``` -## Loading configuration data +## Loading Configuration Data `Configuration` has many methods to load configuration data. **NOTE:** In all cases, configuration key paths are case sensitive. -### From a raw object: +### From a Raw Object: ```swift manager.load([ @@ -51,13 +51,13 @@ manager.load([ ]) ``` -### From command line arguments: +### From Command-line Arguments: ```swift manager.load(.commandLineArguments) ``` -To inject configurations via the commandline at runtime, set configuration values when launching the executable, like so: +To inject configurations via the command-line at runtime, set configuration values when launching the executable, like so: ``` ./myApp --path.to.configuration=value @@ -65,7 +65,7 @@ To inject configurations via the commandline at runtime, set configuration value You can set your preferred argument prefix (`--`) and path separator (`.`) strings when instantiating `ConfigurationManager`. -### From environment variables: +### From Environment Variables: ```swift manager.load(.environmentVariables) @@ -79,14 +79,14 @@ PATH__TO__CONFIGURATION=value You can set your preferred path separator (default `__`) string when instantiating `ConfigurationManager`. -### From a Data object: +### From a Data Object: ```swift let data = Data(...) manager.load(data: data) ``` -### From a file: +### From a File: ```swift manager.load(file: "/path/to/file") @@ -111,7 +111,7 @@ manager.load(file: "../path/to/file", relativeFrom: .customPath("/path/to/somewh **NOTE:** The following `relativeFrom` options, `.executable` (default), `.pwd`, and `.project`, are meant to be used by applications that run from the command-line, and not from within Xcode. This is because the executable and present working directory are different for the application when ran inside Xcode as opposed to when it is ran from the command-line. Under Xcode, this package will change the paths to point to file locations as if the application is running on the command-line. -### From a resource URL: +### From a Resource URL: ```swift manager.load(url: myURL) @@ -119,7 +119,7 @@ manager.load(url: myURL) **NOTE:** The URL MUST include a scheme, i.e., `file://`, `http://`, etc. -### From multiple sources: +### From Multiple Sources: You can chain these methods to load configuration data from multiple sources all at once. If the same configuration key exists in the multiple sources, the one most recently loaded will override the ones loaded earlier. In this simple example, @@ -131,7 +131,7 @@ the value for `foo` is now `baz` because `["foo": "baz"]` was more recently load **NOTE:** Currently, `Configuration` only supports JSON and PLIST formats for resources loaded from data, file, or URL. You can write a custom deserializer to parse additional formats. -## Accessing configuration data +## Accessing Configuration Data To get individual configuration values after they have been loaded, use: @@ -155,7 +155,7 @@ The configuration store is represented as a tree, where the path elements in key } ``` -The value is returned as an instance of `Any`. Therefore, it's important to cast the value to the datatype you want to use. For instance: +The value returned is typed as `Any?`. Therefore, it's important to cast the value to the type you want to use. For instance: ```swift let stringValue = manager["VCAP_SERVICES:cloudantNoSQLDB:0:credentials:host"] as? String diff --git a/Sources/Configuration/ConfigurationManager.swift b/Sources/Configuration/ConfigurationManager.swift index 680123b..b103d48 100644 --- a/Sources/Configuration/ConfigurationManager.swift +++ b/Sources/Configuration/ConfigurationManager.swift @@ -119,7 +119,7 @@ public class ConfigurationManager { return self } - /// Load configurations from command line arguments or environment variables. + /// Load configurations from command-line arguments or environment variables. /// For command line arguments, the configurations are parsed from arguments /// in this format: `=` /// @@ -130,7 +130,7 @@ public class ConfigurationManager { case .commandLineArguments: let argv = CommandLine.arguments - Log.debug("Loading commandline arguments: \(argv)") + Log.debug("Loading command-line arguments: \(argv)") // skip first since it's always the executable for index in 1.. ConfigurationManager { @@ -180,7 +180,7 @@ public class ConfigurationManager { self.load(try deserializer.deserialize(data: data)) } catch { - Log.error("Unable to deserialize data using \"\(deserializerName)\" deserializer") + Log.warning("Unable to deserialize data using \"\(deserializerName)\" deserializer") } return self @@ -196,7 +196,7 @@ public class ConfigurationManager { } } - Log.error("Unable to deserialize data using any known deserializer") + Log.warning("Unable to deserialize data using any known deserializer") return self } @@ -208,7 +208,7 @@ public class ConfigurationManager { /// - Parameter relativeFrom: Optional. Defaults to the location of the executable. /// - Parameter deserializerName: Optional. Designated deserializer for the configuration /// resource. Defaults to `nil`. Pass a value to force the parser to deserialize - /// according to the given format, i.e., `JSONDeserializer.name`; otherwise, parser will + /// according to the given format, i.e., `JSONDeserializer.shared.name`; otherwise, parser will /// go through a list a deserializers and attempt to deserialize using each one. @discardableResult public func load(file: String, @@ -232,27 +232,25 @@ public class ConfigurationManager { pathURL = URL(fileURLWithPath: relativeFrom.path).appendingPathComponent(file).standardized } - Log.verbose("Loading file: \(pathURL)") - return self.load(url: pathURL, deserializerName: deserializerName) } - /// Load configurations from a remote location. + /// Load configurations from a URL location. /// /// - Parameter url: The URL pointing to a configuration resource. /// - Parameter deserializerName: Optional. Designated deserializer for the configuration /// resource. Defaults to `nil`. Pass a value to force the parser to deserialize according to - /// the given format, i.e., `JSONDeserializer.name`; otherwise, parser will go through a list + /// the given format, i.e., `JSONDeserializer.shared.name`; otherwise, parser will go through a list /// a deserializers and attempt to deserialize using each one. @discardableResult public func load(url: URL, deserializerName: String? = nil) -> ConfigurationManager { - Log.verbose("Loading URL: \(url)") + Log.verbose("Loading URL: \(url.standardized.path)") do { try self.load(data: Data(contentsOf: url), deserializerName: deserializerName) } catch { - Log.error("Unable to load data from URL \(url)") + Log.warning("Unable to load data from URL \(url.standardized.path)") } return self diff --git a/Sources/TestProgram/main.swift b/Sources/ConfigurationTestExecutable/main.swift similarity index 100% rename from Sources/TestProgram/main.swift rename to Sources/ConfigurationTestExecutable/main.swift diff --git a/Tests/ConfigurationTests/ConfigurationManagerTest.swift b/Tests/ConfigurationTests/ConfigurationManagerTest.swift index 961b215..bb6ebb8 100644 --- a/Tests/ConfigurationTests/ConfigurationManagerTest.swift +++ b/Tests/ConfigurationTests/ConfigurationManagerTest.swift @@ -61,26 +61,31 @@ class ConfigurationManagerTest: XCTestCase { // Helper function to run shell commands // Tip from http://stackoverflow.com/a/26973384 - func shell(_ args: String..., environment: [String: String] = [:]) -> (Pipe, Pipe, Int32) { + func shell(_ args: String..., + currentDirectoryPath: String = presentWorkingDirectory, + environment: [String: String] = [:]) -> (Pipe, Pipe, Int32) { // Print out the command to be executed var command = "/usr/bin/env" + args.forEach { command.append(" " + $0) } print("Executing command: \(String(describing: command))") #if os(Linux) && !swift(>=3.1) - let process = Task() - #else - let process = Process() + typealias Process = Task #endif + // Configure the Process instance + let process = Process() let errPipe = Pipe() let outPipe = Pipe() - process.launchPath = "/usr/bin/env" process.arguments = args + process.currentDirectoryPath = currentDirectoryPath process.environment = environment + process.launchPath = "/usr/bin/env" process.standardError = errPipe process.standardOutput = outPipe + // Execute the Process instance process.launch() process.waitUntilExit() @@ -189,7 +194,7 @@ class ConfigurationManagerTest: XCTestCase { func testExternalExecutable() { let projectFolder = URL(fileURLWithPath: #file).appendingPathComponent("../../../").standardized - let testProgramURL = projectFolder.appendingPathComponent(".build/debug/TestProgram").standardized + let testProgramURL = projectFolder.appendingPathComponent(".build/debug/ConfigurationTestExecutable").standardized var (errPipe, outPipe, exitCode): (Pipe, Pipe, Int32) var output: String?, error: String? @@ -208,14 +213,16 @@ class ConfigurationManagerTest: XCTestCase { // Need to pass in current environment variables on local machine or it will fail with // `error: Unable to find executable for 'xcrun'` // when ran with Xcode 9 beta - (errPipe, outPipe, exitCode) = shell("swift", "build", "-C", projectFolder.path, environment: ProcessInfo.processInfo.environment) + (errPipe, outPipe, exitCode) = shell("swift", "build", + currentDirectoryPath: projectFolder.path, + environment: ProcessInfo.processInfo.environment) output = String(data: outPipe.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) - print(output ?? "No stdout from `swift build -C \(projectFolder.path)`") + print(output ?? "No stdout from `swift build`") guard exitCode == 0 else { let error = String(data: errPipe.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) - XCTFail(error ?? "No stderr from `swift build -C \(projectFolder.path)`") + XCTFail(error ?? "No stderr from `swift build`") return } #endif diff --git a/docs/Classes.html b/docs/Classes.html index a123fd4..af30107 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -201,7 +201,7 @@

Declaration

diff --git a/docs/Classes/ConfigurationManager.html b/docs/Classes/ConfigurationManager.html index 73ddb98..ce6bff1 100644 --- a/docs/Classes/ConfigurationManager.html +++ b/docs/Classes/ConfigurationManager.html @@ -464,7 +464,7 @@

Parameters

-

Load configurations from command line arguments or environment variables. +

Load configurations from command-line arguments or environment variables. For command line arguments, the configurations are parsed from arguments in this format: <keyPrefix><path>=<value>

@@ -549,7 +549,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize according to -the given format, i.e., JSONDeserializer.name; otherwise, parser will go through a list +the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -624,7 +624,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize -according to the given format, i.e., JSONDeserializer.name; otherwise, parser will +according to the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -648,7 +648,7 @@

Parameters

-

Load configurations from a remote location.

+

Load configurations from a URL location.

@@ -685,7 +685,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize according to -the given format, i.e., JSONDeserializer.name; otherwise, parser will go through a list +the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -777,7 +777,7 @@

Declaration

diff --git a/docs/Classes/ConfigurationManager/BasePath.html b/docs/Classes/ConfigurationManager/BasePath.html index 0ada891..8a8d44f 100644 --- a/docs/Classes/ConfigurationManager/BasePath.html +++ b/docs/Classes/ConfigurationManager/BasePath.html @@ -259,7 +259,7 @@

Declaration

diff --git a/docs/Classes/ConfigurationManager/Source.html b/docs/Classes/ConfigurationManager/Source.html index c1ec71d..0037063 100644 --- a/docs/Classes/ConfigurationManager/Source.html +++ b/docs/Classes/ConfigurationManager/Source.html @@ -167,7 +167,7 @@

Declaration

diff --git a/docs/Classes/JSONDeserializer.html b/docs/Classes/JSONDeserializer.html index 6c0638d..546bac8 100644 --- a/docs/Classes/JSONDeserializer.html +++ b/docs/Classes/JSONDeserializer.html @@ -210,7 +210,7 @@

Parameters

diff --git a/docs/Classes/PLISTDeserializer.html b/docs/Classes/PLISTDeserializer.html index aeb16fc..8e8c090 100644 --- a/docs/Classes/PLISTDeserializer.html +++ b/docs/Classes/PLISTDeserializer.html @@ -210,7 +210,7 @@

Parameters

diff --git a/docs/Protocols.html b/docs/Protocols.html index 0d64ff2..48ca017 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -132,7 +132,7 @@

Declaration

diff --git a/docs/Protocols/Deserializer.html b/docs/Protocols/Deserializer.html index bddf362..3d1292e 100644 --- a/docs/Protocols/Deserializer.html +++ b/docs/Protocols/Deserializer.html @@ -184,7 +184,7 @@

Parameters

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes.html index a123fd4..af30107 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes.html @@ -201,7 +201,7 @@

Declaration

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager.html index 73ddb98..ce6bff1 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager.html @@ -464,7 +464,7 @@

Parameters

-

Load configurations from command line arguments or environment variables. +

Load configurations from command-line arguments or environment variables. For command line arguments, the configurations are parsed from arguments in this format: <keyPrefix><path>=<value>

@@ -549,7 +549,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize according to -the given format, i.e., JSONDeserializer.name; otherwise, parser will go through a list +the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -624,7 +624,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize -according to the given format, i.e., JSONDeserializer.name; otherwise, parser will +according to the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -648,7 +648,7 @@

Parameters

-

Load configurations from a remote location.

+

Load configurations from a URL location.

@@ -685,7 +685,7 @@

Parameters

Optional. Designated deserializer for the configuration resource. Defaults to nil. Pass a value to force the parser to deserialize according to -the given format, i.e., JSONDeserializer.name; otherwise, parser will go through a list +the given format, i.e., JSONDeserializer.shared.name; otherwise, parser will go through a list a deserializers and attempt to deserialize using each one.

@@ -777,7 +777,7 @@

Declaration

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/BasePath.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/BasePath.html index 0ada891..8a8d44f 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/BasePath.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/BasePath.html @@ -259,7 +259,7 @@

Declaration

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/Source.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/Source.html index c1ec71d..0037063 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/Source.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/ConfigurationManager/Source.html @@ -167,7 +167,7 @@

Declaration

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/JSONDeserializer.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/JSONDeserializer.html index 6c0638d..546bac8 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/JSONDeserializer.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/JSONDeserializer.html @@ -210,7 +210,7 @@

Parameters

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/PLISTDeserializer.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/PLISTDeserializer.html index aeb16fc..8e8c090 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/PLISTDeserializer.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Classes/PLISTDeserializer.html @@ -210,7 +210,7 @@

Parameters

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols.html index 0d64ff2..48ca017 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols.html @@ -132,7 +132,7 @@

Declaration

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols/Deserializer.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols/Deserializer.html index bddf362..3d1292e 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols/Deserializer.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/Protocols/Deserializer.html @@ -184,7 +184,7 @@

Parameters

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/index.html b/docs/docsets/Configuration.docset/Contents/Resources/Documents/index.html index 2d12ed9..9c4b267 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/index.html @@ -86,7 +86,7 @@

Configuration

-

Build Status - Master +

Build Status macOS Linux Apache 2 @@ -114,12 +114,12 @@

Usage

manager.load(file: "config.json").load(.environmentVariables)
 let value = manager["path:to:configuration:value"]
 
-

Loading configuration data

+

Loading Configuration Data

Configuration has many methods to load configuration data.

NOTE: In all cases, configuration key paths are case sensitive.

-

From a raw object:

+

From a Raw Object:

manager.load([
     "hello": "world",
     "foo": [
@@ -127,16 +127,16 @@ 

From a raw object:

] ])
-

From command line arguments:

+

From Command-line Arguments:

manager.load(.commandLineArguments)
 
-

To inject configurations via the commandline at runtime, set configuration values when launching the executable, like so:

+

To inject configurations via the command-line at runtime, set configuration values when launching the executable, like so:

./myApp --path.to.configuration=value
 

You can set your preferred argument prefix (--) and path separator (.) strings when instantiating ConfigurationManager.

-

From environment variables:

+

From Environment Variables:

manager.load(.environmentVariables)
 
@@ -145,11 +145,11 @@

From environment variables:<

You can set your preferred path separator (default __) string when instantiating ConfigurationManager.

-

From a Data object:

+

From a Data Object:

let data = Data(...)
 manager.load(data: data)
 
-

From a file:

+

From a File:

manager.load(file: "/path/to/file")
 
@@ -168,13 +168,13 @@

From a file:

manager.load(file: "../path/to/file", relativeFrom: .customPath("/path/to/somewhere/on/file/system")) -

NOTE: The following relativeFrom options, .executable (default), .pwd, and .project, are meant to be used by applications that run from the command-line, and not from within Xcode. This is because the executable and present working directory are different for the application when ran inside Xcode as opposed to when it is ran from the command-line.

-

From a resource URL:

+

NOTE: The following relativeFrom options, .executable (default), .pwd, and .project, are meant to be used by applications that run from the command-line, and not from within Xcode. This is because the executable and present working directory are different for the application when ran inside Xcode as opposed to when it is ran from the command-line. Under Xcode, this package will change the paths to point to file locations as if the application is running on the command-line.

+

From a Resource URL:

manager.load(url: myURL)
 

NOTE: The URL MUST include a scheme, i.e., file://, http://, etc.

-

From multiple sources:

+

From Multiple Sources:

You can chain these methods to load configuration data from multiple sources all at once. If the same configuration key exists in the multiple sources, the one most recently loaded will override the ones loaded earlier. In this simple example,

manager.load(["foo": "bar"]).load(["foo": "baz"])
@@ -183,7 +183,7 @@ 

From multiple sources:

the value for foo is now baz because ["foo": "baz"] was more recently loaded than ["foo": "bar"]. The same behavior applies to all other load functions.

NOTE: Currently, Configuration only supports JSON and PLIST formats for resources loaded from data, file, or URL. You can write a custom deserializer to parse additional formats.

-

Accessing configuration data

+

Accessing Configuration Data

To get individual configuration values after they have been loaded, use:

manager["path:to:configuration"]
@@ -203,7 +203,7 @@ 

Accessing configuration da }

-

The value is returned as an instance of Any. Therefore, it’s important to cast the value to the datatype you want to use. For instance:

+

The value returned is typed as Any?. Therefore, it’s important to cast the value to the type you want to use. For instance:

let stringValue = manager["VCAP_SERVICES:cloudantNoSQLDB:0:credentials:host"] as? String
 
@@ -228,7 +228,7 @@

License

diff --git a/docs/docsets/Configuration.docset/Contents/Resources/Documents/search.json b/docs/docsets/Configuration.docset/Contents/Resources/Documents/search.json index 67ad744..503e92f 100644 --- a/docs/docsets/Configuration.docset/Contents/Resources/Documents/search.json +++ b/docs/docsets/Configuration.docset/Contents/Resources/Documents/search.json @@ -1 +1 @@ -{"Protocols/Deserializer.html#/s:vP13Configuration12Deserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"Deserializer"},"Protocols/Deserializer.html#/s:FP13Configuration12Deserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw data into a Foundation object

","parent_name":"Deserializer"},"Protocols/Deserializer.html":{"name":"Deserializer","abstract":"

Deserializer protocol

"},"Classes/PLISTDeserializer.html#/s:ZvC13Configuration17PLISTDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:vC13Configuration17PLISTDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:FC13Configuration17PLISTDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw PLIST data into a Foundation object

","parent_name":"PLISTDeserializer"},"Classes/JSONDeserializer.html#/s:ZvC13Configuration16JSONDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:vC13Configuration16JSONDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:FC13Configuration16JSONDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw JSON data into a Foundation object

","parent_name":"JSONDeserializer"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10executableFMS1_S1_":{"name":"executable","abstract":"

Relative from executable location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath7projectFMS1_S1_":{"name":"project","abstract":"

Relative from project directory

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath3pwdFMS1_S1_":{"name":"pwd","abstract":"

Relative from present working directory (PWD)

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10customPathFMS1_FSSS1_":{"name":"customPath","abstract":"

Relative from a custom location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:vOC13Configuration20ConfigurationManager8BasePath4pathSS":{"name":"path","abstract":"

Get the absolute path as denoted by self

","parent_name":"BasePath"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20commandLineArgumentsFMS1_S1_":{"name":"commandLineArguments","abstract":"

Flag to load configurations from commandline arguments

","parent_name":"Source"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20environmentVariablesFMS1_S1_":{"name":"environmentVariables","abstract":"

Flag to load configurations from environment variables

","parent_name":"Source"},"Classes/ConfigurationManager.html#/s:iC13Configuration20ConfigurationManager9subscriptFSSGSqP__":{"name":"subscript(_:)","abstract":"

Access configurations by paths.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager28commandLineArgumentKeyPrefixSS":{"name":"commandLineArgumentKeyPrefix","abstract":"

Defaults to --

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32commandLineArgumentPathSeparatorSS":{"name":"commandLineArgumentPathSeparator","abstract":"

Defaults to .

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32environmentVariablePathSeparatorSS":{"name":"environmentVariablePathSeparator","abstract":"

Defaults to __

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager19parseStringToObjectSb":{"name":"parseStringToObject","abstract":"

Defaults to true

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/Source.html":{"name":"Source","abstract":"

Enum to specify configuration source between commandline arguments","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/BasePath.html":{"name":"BasePath","abstract":"

Base paths for resolving relative paths

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManagercFT28commandLineArgumentKeyPrefixSS32commandLineArgumentPathSeparatorSS32environmentVariablePathSeparatorSS19parseStringToObjectSb_S0_":{"name":"init(commandLineArgumentKeyPrefix:commandLineArgumentPathSeparator:environmentVariablePathSeparator:parseStringToObject:)","abstract":"

Constructor

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFP_S0_":{"name":"load(_:)","abstract":"

Load configurations from raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFOS0_6SourceS0_":{"name":"load(_:)","abstract":"

Load configurations from command line arguments or environment variables.","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4dataV10Foundation4Data16deserializerNameGSqSS__S0_":{"name":"load(data:deserializerName:)","abstract":"

Load configurations from a Data object

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4fileSS12relativeFromOS0_8BasePath16deserializerNameGSqSS__S0_":{"name":"load(file:relativeFrom:deserializerName:)","abstract":"

Load configurations from a file on system.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT3urlV10Foundation3URL16deserializerNameGSqSS__S0_":{"name":"load(url:deserializerName:)","abstract":"

Load configurations from a remote location.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager3useFPS_12Deserializer_S0_":{"name":"use(_:)","abstract":"

Add a deserializer to the list of deserializers that can be used to parse raw data.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager10getConfigsFT_P_":{"name":"getConfigs()","abstract":"

Get all configurations that have been merged in the manager as a raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html":{"name":"ConfigurationManager","abstract":"

ConfigurationManager class

"},"Classes/JSONDeserializer.html":{"name":"JSONDeserializer","abstract":"

Default JSON deserializer implementation

"},"Classes/PLISTDeserializer.html":{"name":"PLISTDeserializer","abstract":"

Default PLIST deserializer implementation

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"}} \ No newline at end of file +{"Protocols/Deserializer.html#/s:vP13Configuration12Deserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"Deserializer"},"Protocols/Deserializer.html#/s:FP13Configuration12Deserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw data into a Foundation object

","parent_name":"Deserializer"},"Protocols/Deserializer.html":{"name":"Deserializer","abstract":"

Deserializer protocol

"},"Classes/PLISTDeserializer.html#/s:ZvC13Configuration17PLISTDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:vC13Configuration17PLISTDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:FC13Configuration17PLISTDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw PLIST data into a Foundation object

","parent_name":"PLISTDeserializer"},"Classes/JSONDeserializer.html#/s:ZvC13Configuration16JSONDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:vC13Configuration16JSONDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:FC13Configuration16JSONDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw JSON data into a Foundation object

","parent_name":"JSONDeserializer"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10executableFMS1_S1_":{"name":"executable","abstract":"

Relative from executable location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath7projectFMS1_S1_":{"name":"project","abstract":"

Relative from project directory

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath3pwdFMS1_S1_":{"name":"pwd","abstract":"

Relative from present working directory (PWD)

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10customPathFMS1_FSSS1_":{"name":"customPath","abstract":"

Relative from a custom location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:vOC13Configuration20ConfigurationManager8BasePath4pathSS":{"name":"path","abstract":"

Get the absolute path as denoted by self

","parent_name":"BasePath"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20commandLineArgumentsFMS1_S1_":{"name":"commandLineArguments","abstract":"

Flag to load configurations from commandline arguments

","parent_name":"Source"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20environmentVariablesFMS1_S1_":{"name":"environmentVariables","abstract":"

Flag to load configurations from environment variables

","parent_name":"Source"},"Classes/ConfigurationManager.html#/s:iC13Configuration20ConfigurationManager9subscriptFSSGSqP__":{"name":"subscript(_:)","abstract":"

Access configurations by paths.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager28commandLineArgumentKeyPrefixSS":{"name":"commandLineArgumentKeyPrefix","abstract":"

Defaults to --

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32commandLineArgumentPathSeparatorSS":{"name":"commandLineArgumentPathSeparator","abstract":"

Defaults to .

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32environmentVariablePathSeparatorSS":{"name":"environmentVariablePathSeparator","abstract":"

Defaults to __

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager19parseStringToObjectSb":{"name":"parseStringToObject","abstract":"

Defaults to true

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/Source.html":{"name":"Source","abstract":"

Enum to specify configuration source between commandline arguments","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/BasePath.html":{"name":"BasePath","abstract":"

Base paths for resolving relative paths

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManagercFT28commandLineArgumentKeyPrefixSS32commandLineArgumentPathSeparatorSS32environmentVariablePathSeparatorSS19parseStringToObjectSb_S0_":{"name":"init(commandLineArgumentKeyPrefix:commandLineArgumentPathSeparator:environmentVariablePathSeparator:parseStringToObject:)","abstract":"

Constructor

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFP_S0_":{"name":"load(_:)","abstract":"

Load configurations from raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFOS0_6SourceS0_":{"name":"load(_:)","abstract":"

Load configurations from command-line arguments or environment variables.","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4dataV10Foundation4Data16deserializerNameGSqSS__S0_":{"name":"load(data:deserializerName:)","abstract":"

Load configurations from a Data object

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4fileSS12relativeFromOS0_8BasePath16deserializerNameGSqSS__S0_":{"name":"load(file:relativeFrom:deserializerName:)","abstract":"

Load configurations from a file on system.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT3urlV10Foundation3URL16deserializerNameGSqSS__S0_":{"name":"load(url:deserializerName:)","abstract":"

Load configurations from a URL location.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager3useFPS_12Deserializer_S0_":{"name":"use(_:)","abstract":"

Add a deserializer to the list of deserializers that can be used to parse raw data.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager10getConfigsFT_P_":{"name":"getConfigs()","abstract":"

Get all configurations that have been merged in the manager as a raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html":{"name":"ConfigurationManager","abstract":"

ConfigurationManager class

"},"Classes/JSONDeserializer.html":{"name":"JSONDeserializer","abstract":"

Default JSON deserializer implementation

"},"Classes/PLISTDeserializer.html":{"name":"PLISTDeserializer","abstract":"

Default PLIST deserializer implementation

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"}} \ No newline at end of file diff --git a/docs/docsets/Configuration.tgz b/docs/docsets/Configuration.tgz index 74b31f7..efcb0da 100644 Binary files a/docs/docsets/Configuration.tgz and b/docs/docsets/Configuration.tgz differ diff --git a/docs/index.html b/docs/index.html index 2d12ed9..9c4b267 100644 --- a/docs/index.html +++ b/docs/index.html @@ -86,7 +86,7 @@

Configuration

-

Build Status - Master +

Build Status macOS Linux Apache 2 @@ -114,12 +114,12 @@

Usage

manager.load(file: "config.json").load(.environmentVariables)
 let value = manager["path:to:configuration:value"]
 
-

Loading configuration data

+

Loading Configuration Data

Configuration has many methods to load configuration data.

NOTE: In all cases, configuration key paths are case sensitive.

-

From a raw object:

+

From a Raw Object:

manager.load([
     "hello": "world",
     "foo": [
@@ -127,16 +127,16 @@ 

From a raw object:

] ])
-

From command line arguments:

+

From Command-line Arguments:

manager.load(.commandLineArguments)
 
-

To inject configurations via the commandline at runtime, set configuration values when launching the executable, like so:

+

To inject configurations via the command-line at runtime, set configuration values when launching the executable, like so:

./myApp --path.to.configuration=value
 

You can set your preferred argument prefix (--) and path separator (.) strings when instantiating ConfigurationManager.

-

From environment variables:

+

From Environment Variables:

manager.load(.environmentVariables)
 
@@ -145,11 +145,11 @@

From environment variables:<

You can set your preferred path separator (default __) string when instantiating ConfigurationManager.

-

From a Data object:

+

From a Data Object:

let data = Data(...)
 manager.load(data: data)
 
-

From a file:

+

From a File:

manager.load(file: "/path/to/file")
 
@@ -168,13 +168,13 @@

From a file:

manager.load(file: "../path/to/file", relativeFrom: .customPath("/path/to/somewhere/on/file/system")) -

NOTE: The following relativeFrom options, .executable (default), .pwd, and .project, are meant to be used by applications that run from the command-line, and not from within Xcode. This is because the executable and present working directory are different for the application when ran inside Xcode as opposed to when it is ran from the command-line.

-

From a resource URL:

+

NOTE: The following relativeFrom options, .executable (default), .pwd, and .project, are meant to be used by applications that run from the command-line, and not from within Xcode. This is because the executable and present working directory are different for the application when ran inside Xcode as opposed to when it is ran from the command-line. Under Xcode, this package will change the paths to point to file locations as if the application is running on the command-line.

+

From a Resource URL:

manager.load(url: myURL)
 

NOTE: The URL MUST include a scheme, i.e., file://, http://, etc.

-

From multiple sources:

+

From Multiple Sources:

You can chain these methods to load configuration data from multiple sources all at once. If the same configuration key exists in the multiple sources, the one most recently loaded will override the ones loaded earlier. In this simple example,

manager.load(["foo": "bar"]).load(["foo": "baz"])
@@ -183,7 +183,7 @@ 

From multiple sources:

the value for foo is now baz because ["foo": "baz"] was more recently loaded than ["foo": "bar"]. The same behavior applies to all other load functions.

NOTE: Currently, Configuration only supports JSON and PLIST formats for resources loaded from data, file, or URL. You can write a custom deserializer to parse additional formats.

-

Accessing configuration data

+

Accessing Configuration Data

To get individual configuration values after they have been loaded, use:

manager["path:to:configuration"]
@@ -203,7 +203,7 @@ 

Accessing configuration da }

-

The value is returned as an instance of Any. Therefore, it’s important to cast the value to the datatype you want to use. For instance:

+

The value returned is typed as Any?. Therefore, it’s important to cast the value to the type you want to use. For instance:

let stringValue = manager["VCAP_SERVICES:cloudantNoSQLDB:0:credentials:host"] as? String
 
@@ -228,7 +228,7 @@

License

diff --git a/docs/search.json b/docs/search.json index 67ad744..503e92f 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -{"Protocols/Deserializer.html#/s:vP13Configuration12Deserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"Deserializer"},"Protocols/Deserializer.html#/s:FP13Configuration12Deserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw data into a Foundation object

","parent_name":"Deserializer"},"Protocols/Deserializer.html":{"name":"Deserializer","abstract":"

Deserializer protocol

"},"Classes/PLISTDeserializer.html#/s:ZvC13Configuration17PLISTDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:vC13Configuration17PLISTDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:FC13Configuration17PLISTDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw PLIST data into a Foundation object

","parent_name":"PLISTDeserializer"},"Classes/JSONDeserializer.html#/s:ZvC13Configuration16JSONDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:vC13Configuration16JSONDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:FC13Configuration16JSONDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw JSON data into a Foundation object

","parent_name":"JSONDeserializer"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10executableFMS1_S1_":{"name":"executable","abstract":"

Relative from executable location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath7projectFMS1_S1_":{"name":"project","abstract":"

Relative from project directory

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath3pwdFMS1_S1_":{"name":"pwd","abstract":"

Relative from present working directory (PWD)

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10customPathFMS1_FSSS1_":{"name":"customPath","abstract":"

Relative from a custom location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:vOC13Configuration20ConfigurationManager8BasePath4pathSS":{"name":"path","abstract":"

Get the absolute path as denoted by self

","parent_name":"BasePath"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20commandLineArgumentsFMS1_S1_":{"name":"commandLineArguments","abstract":"

Flag to load configurations from commandline arguments

","parent_name":"Source"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20environmentVariablesFMS1_S1_":{"name":"environmentVariables","abstract":"

Flag to load configurations from environment variables

","parent_name":"Source"},"Classes/ConfigurationManager.html#/s:iC13Configuration20ConfigurationManager9subscriptFSSGSqP__":{"name":"subscript(_:)","abstract":"

Access configurations by paths.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager28commandLineArgumentKeyPrefixSS":{"name":"commandLineArgumentKeyPrefix","abstract":"

Defaults to --

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32commandLineArgumentPathSeparatorSS":{"name":"commandLineArgumentPathSeparator","abstract":"

Defaults to .

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32environmentVariablePathSeparatorSS":{"name":"environmentVariablePathSeparator","abstract":"

Defaults to __

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager19parseStringToObjectSb":{"name":"parseStringToObject","abstract":"

Defaults to true

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/Source.html":{"name":"Source","abstract":"

Enum to specify configuration source between commandline arguments","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/BasePath.html":{"name":"BasePath","abstract":"

Base paths for resolving relative paths

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManagercFT28commandLineArgumentKeyPrefixSS32commandLineArgumentPathSeparatorSS32environmentVariablePathSeparatorSS19parseStringToObjectSb_S0_":{"name":"init(commandLineArgumentKeyPrefix:commandLineArgumentPathSeparator:environmentVariablePathSeparator:parseStringToObject:)","abstract":"

Constructor

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFP_S0_":{"name":"load(_:)","abstract":"

Load configurations from raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFOS0_6SourceS0_":{"name":"load(_:)","abstract":"

Load configurations from command line arguments or environment variables.","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4dataV10Foundation4Data16deserializerNameGSqSS__S0_":{"name":"load(data:deserializerName:)","abstract":"

Load configurations from a Data object

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4fileSS12relativeFromOS0_8BasePath16deserializerNameGSqSS__S0_":{"name":"load(file:relativeFrom:deserializerName:)","abstract":"

Load configurations from a file on system.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT3urlV10Foundation3URL16deserializerNameGSqSS__S0_":{"name":"load(url:deserializerName:)","abstract":"

Load configurations from a remote location.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager3useFPS_12Deserializer_S0_":{"name":"use(_:)","abstract":"

Add a deserializer to the list of deserializers that can be used to parse raw data.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager10getConfigsFT_P_":{"name":"getConfigs()","abstract":"

Get all configurations that have been merged in the manager as a raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html":{"name":"ConfigurationManager","abstract":"

ConfigurationManager class

"},"Classes/JSONDeserializer.html":{"name":"JSONDeserializer","abstract":"

Default JSON deserializer implementation

"},"Classes/PLISTDeserializer.html":{"name":"PLISTDeserializer","abstract":"

Default PLIST deserializer implementation

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"}} \ No newline at end of file +{"Protocols/Deserializer.html#/s:vP13Configuration12Deserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"Deserializer"},"Protocols/Deserializer.html#/s:FP13Configuration12Deserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw data into a Foundation object

","parent_name":"Deserializer"},"Protocols/Deserializer.html":{"name":"Deserializer","abstract":"

Deserializer protocol

"},"Classes/PLISTDeserializer.html#/s:ZvC13Configuration17PLISTDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:vC13Configuration17PLISTDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"PLISTDeserializer"},"Classes/PLISTDeserializer.html#/s:FC13Configuration17PLISTDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw PLIST data into a Foundation object

","parent_name":"PLISTDeserializer"},"Classes/JSONDeserializer.html#/s:ZvC13Configuration16JSONDeserializer6sharedS0_":{"name":"shared","abstract":"

A shared instance

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:vC13Configuration16JSONDeserializer4nameSS":{"name":"name","abstract":"

A unique name that identifies this deserializer

","parent_name":"JSONDeserializer"},"Classes/JSONDeserializer.html#/s:FC13Configuration16JSONDeserializer11deserializeFzT4dataV10Foundation4Data_P_":{"name":"deserialize(data:)","abstract":"

Function that deserializes raw JSON data into a Foundation object

","parent_name":"JSONDeserializer"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10executableFMS1_S1_":{"name":"executable","abstract":"

Relative from executable location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath7projectFMS1_S1_":{"name":"project","abstract":"

Relative from project directory

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath3pwdFMS1_S1_":{"name":"pwd","abstract":"

Relative from present working directory (PWD)

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:FOC13Configuration20ConfigurationManager8BasePath10customPathFMS1_FSSS1_":{"name":"customPath","abstract":"

Relative from a custom location

","parent_name":"BasePath"},"Classes/ConfigurationManager/BasePath.html#/s:vOC13Configuration20ConfigurationManager8BasePath4pathSS":{"name":"path","abstract":"

Get the absolute path as denoted by self

","parent_name":"BasePath"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20commandLineArgumentsFMS1_S1_":{"name":"commandLineArguments","abstract":"

Flag to load configurations from commandline arguments

","parent_name":"Source"},"Classes/ConfigurationManager/Source.html#/s:FOC13Configuration20ConfigurationManager6Source20environmentVariablesFMS1_S1_":{"name":"environmentVariables","abstract":"

Flag to load configurations from environment variables

","parent_name":"Source"},"Classes/ConfigurationManager.html#/s:iC13Configuration20ConfigurationManager9subscriptFSSGSqP__":{"name":"subscript(_:)","abstract":"

Access configurations by paths.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager28commandLineArgumentKeyPrefixSS":{"name":"commandLineArgumentKeyPrefix","abstract":"

Defaults to --

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32commandLineArgumentPathSeparatorSS":{"name":"commandLineArgumentPathSeparator","abstract":"

Defaults to .

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager32environmentVariablePathSeparatorSS":{"name":"environmentVariablePathSeparator","abstract":"

Defaults to __

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:vC13Configuration20ConfigurationManager19parseStringToObjectSb":{"name":"parseStringToObject","abstract":"

Defaults to true

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/Source.html":{"name":"Source","abstract":"

Enum to specify configuration source between commandline arguments","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager/BasePath.html":{"name":"BasePath","abstract":"

Base paths for resolving relative paths

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManagercFT28commandLineArgumentKeyPrefixSS32commandLineArgumentPathSeparatorSS32environmentVariablePathSeparatorSS19parseStringToObjectSb_S0_":{"name":"init(commandLineArgumentKeyPrefix:commandLineArgumentPathSeparator:environmentVariablePathSeparator:parseStringToObject:)","abstract":"

Constructor

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFP_S0_":{"name":"load(_:)","abstract":"

Load configurations from raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFOS0_6SourceS0_":{"name":"load(_:)","abstract":"

Load configurations from command-line arguments or environment variables.","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4dataV10Foundation4Data16deserializerNameGSqSS__S0_":{"name":"load(data:deserializerName:)","abstract":"

Load configurations from a Data object

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT4fileSS12relativeFromOS0_8BasePath16deserializerNameGSqSS__S0_":{"name":"load(file:relativeFrom:deserializerName:)","abstract":"

Load configurations from a file on system.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager4loadFT3urlV10Foundation3URL16deserializerNameGSqSS__S0_":{"name":"load(url:deserializerName:)","abstract":"

Load configurations from a URL location.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager3useFPS_12Deserializer_S0_":{"name":"use(_:)","abstract":"

Add a deserializer to the list of deserializers that can be used to parse raw data.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html#/s:FC13Configuration20ConfigurationManager10getConfigsFT_P_":{"name":"getConfigs()","abstract":"

Get all configurations that have been merged in the manager as a raw object.

","parent_name":"ConfigurationManager"},"Classes/ConfigurationManager.html":{"name":"ConfigurationManager","abstract":"

ConfigurationManager class

"},"Classes/JSONDeserializer.html":{"name":"JSONDeserializer","abstract":"

Default JSON deserializer implementation

"},"Classes/PLISTDeserializer.html":{"name":"PLISTDeserializer","abstract":"

Default PLIST deserializer implementation

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"}} \ No newline at end of file