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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96b4ca3a0338186d176e8e77df875cdb958e6cbe
4
- data.tar.gz: 2e983b83fb64464a0ee2e6c2c976906b0ef6a47d
3
+ metadata.gz: 9117fdb77e42657ac1622e75aeb9382fc5e477c6
4
+ data.tar.gz: 72c91e2bef7fe86d0301f79330fbcc27cdf9f7e1
5
5
  SHA512:
6
- metadata.gz: 23896ceb5b3917c44f167a5aff6384a2f15ad7f9d93a9de5bf2cbd10f93f58067c53517cfb95c75eb3d017905a03ee3991956715ea8189626d0fb31d2cca1735
7
- data.tar.gz: 0399e6c24c8d608cd265e591fe85d80d1288d351f0901e8354df0d639c8f9e9cd09a94c12edf0195e85b0c001268ca9f8f936bd4dede0a928c74c0c592a2d3a3
6
+ metadata.gz: 63745f8e5de02729ae5b67169da20d988bfb253bd48a71f2a93b1057676db0075b99259d38defedeabc6ce4e1144fd13458dfe76ec88e148a01998ef570c8b6e
7
+ data.tar.gz: ead1eea39f41bfa3f157eb084d89742efb0ecb4eed799a8a23333846c20f91a029467bb58e1a303bdcbd5e91978d0902158ce539af35d49c3e10f46e9b66ee04
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/README.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # SoarConfiguration
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/soar_configuration`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
26
-
27
- ## Development
37
+ ```ruby
38
+ configuration = SoarConfiguration::Configuration.new
39
+ config, errors = configuration.load_from_yaml("config/config.yml")
40
+ ```
28
41
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+ ```ruby
43
+ configuration = SoarConfiguration::Configuration.new
44
+ config, errors = configuration.load_from_configuration_service(environment)
45
+ ```
30
46
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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 pull requests are welcome on GitHub at https://github.com/[USERNAME]/soar_configuration.
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
 
@@ -1,3 +1,3 @@
1
1
  module SoarConfiguration
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-15 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configuration_service