soar_configuration 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +24 -9
- data/lib/soar_configuration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9117fdb77e42657ac1622e75aeb9382fc5e477c6
|
4
|
+
data.tar.gz: 72c91e2bef7fe86d0301f79330fbcc27cdf9f7e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63745f8e5de02729ae5b67169da20d988bfb253bd48a71f2a93b1057676db0075b99259d38defedeabc6ce4e1144fd13458dfe76ec88e148a01998ef570c8b6e
|
7
|
+
data.tar.gz: ead1eea39f41bfa3f157eb084d89742efb0ecb4eed799a8a23333846c20f91a029467bb58e1a303bdcbd5e91978d0902158ce539af35d49c3e10f46e9b66ee04
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# SoarConfiguration
|
2
2
|
|
3
|
-
|
3
|
+
This library supports retrieving a configuration from a configuration server, given an environment that includes the configuration server details or from a YAML file using the filename provided.
|
4
4
|
|
5
|
-
|
5
|
+
The configuration is then validated by instantiating the class indicated using the 'validator' key. If such an entry does not exist, validation uses the default validator included in this library: 'SoarConfiguration::ConfigurationValidator'. The default validator ensures that the configuration is a dictionary.
|
6
|
+
|
7
|
+
## Errors
|
8
|
+
|
9
|
+
Errors are returned in an error array:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
config, errors = configuration.load_from_...
|
13
|
+
```
|
14
|
+
|
15
|
+
'invalid configuration' if the configuration is not a dictionary
|
16
|
+
'invalid configuration service URI' if an invalid configuration service URI was provided
|
17
|
+
'Could not load or parse configuration file. Is it YAML?' if the YAML file could not be parsed or loaded
|
6
18
|
|
7
19
|
## Installation
|
8
20
|
|
@@ -22,18 +34,21 @@ Or install it yourself as:
|
|
22
34
|
|
23
35
|
## Usage
|
24
36
|
|
25
|
-
|
26
|
-
|
27
|
-
|
37
|
+
```ruby
|
38
|
+
configuration = SoarConfiguration::Configuration.new
|
39
|
+
config, errors = configuration.load_from_yaml("config/config.yml")
|
40
|
+
```
|
28
41
|
|
29
|
-
|
42
|
+
```ruby
|
43
|
+
configuration = SoarConfiguration::Configuration.new
|
44
|
+
config, errors = configuration.load_from_configuration_service(environment)
|
45
|
+
```
|
30
46
|
|
31
|
-
|
47
|
+
For details on the environment, see the [configuration_service] (https://rubygems.org/gems/configuration_service) and [configuration_service-provider-vault] (https://rubygems.org/gems/configuration_service-provider-vault) gems.
|
32
48
|
|
33
49
|
## Contributing
|
34
50
|
|
35
|
-
Bug reports and
|
36
|
-
|
51
|
+
Bug reports and feature requests are welcome by email to ernst dot van dot graan at hetzner dot co dot za. This gem is sponsored by Hetzner (Pty) Ltd (http://hetzner.co.za)
|
37
52
|
|
38
53
|
## License
|
39
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar_configuration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernst Van Graan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configuration_service
|