constancy 0.1.4 → 0.1.5

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: fc2e9db6619985c8a4f5a9b52b26c54100ef32e1
4
- data.tar.gz: feeb46b8b6d63c7a55c61060daf70ef032456530
3
+ metadata.gz: 7f2b5ae0525b88e9fc9b56f9d5bdcd4d84c143a3
4
+ data.tar.gz: 6350e6dec7a606733ba292e002bc423dff8634af
5
5
  SHA512:
6
- metadata.gz: 1fd58215c1eb8d513976504692d77e71f0498419cb95a8c592772480504d47dc678fe577047ad7269c46230be1314cd97bbcf0dc0c57d793330605cde8811b7a
7
- data.tar.gz: 9b86de0c1bd385ee5647392706ce4d59d7e3ab1f676127ad717a85943267ce73482460c9234ecf77e339b2e9635a6c63a1d2bd6870d7d4534a9becd63be53a14
6
+ metadata.gz: 213832240c59baf7d8289a27cc5829d66c7cc6e61a072eaf9a25b20d54d6929f21c8b85a76ac6c0f76cd704dbe180d21a30e0d1adc58564f3d964d58f15e80b7
7
+ data.tar.gz: c013397a8786af4f9f309a80217440b069c0459f7d71a8c072d1de34c366abbc2f2e4f2c69a31f960f560589e2c681bbe291e40310ff37cf2bba426913661093
data/LICENSE CHANGED
@@ -1,21 +1,12 @@
1
- MIT License
1
+ This work is dedicated to the public domain. No rights reserved.
2
2
 
3
- Copyright (c) 2017 Instructure, Inc.
3
+ I, the copyright holder of this work, hereby release it into the public
4
+ domain. This applies worldwide.
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
6
+ I grant any entity the right to use this work for any purpose, without
7
+ any conditions, unless such conditions are required by law.
11
8
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
9
+ If you require a fuller legal statement, please refer to the Creative
10
+ Commons Zero license:
14
11
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
12
+ http://creativecommons.org/publicdomain/zero/1.0/
data/README.md CHANGED
@@ -157,6 +157,25 @@ You can run `constancy config` to get a summary of the defined configuration
157
157
  and to double-check config syntax.
158
158
 
159
159
 
160
+ ### Dynamic configuration
161
+
162
+ The configuration file will be rendered through ERB before being parsed as
163
+ YAML. This can be useful for avoiding repetitive configuration across multiple
164
+ prefixes or datacenters, eg:
165
+
166
+ sync:
167
+ <% %w( dc1 dc2 dc3 ).each do |dc| %>
168
+ - name: <%= dc %>:myapp-private
169
+ prefix: private/myapp
170
+ datacenter: <%= dc %>
171
+ path: consul/<%= dc %>/private
172
+ delete: true
173
+ <% end %>
174
+
175
+ It's a good idea to sanity-check your ERB by running `constancy config` after
176
+ making any changes.
177
+
178
+
160
179
  ### Environment configuration
161
180
 
162
181
  Constancy may be partially configured using environment variables:
@@ -1,5 +1,6 @@
1
1
  # This software is public domain. No rights are reserved. See LICENSE for more information.
2
2
 
3
+ require 'erb'
3
4
  require 'yaml'
4
5
  require 'imperium'
5
6
 
@@ -69,7 +69,7 @@ class Constancy
69
69
  def parse!
70
70
  raw = {}
71
71
  begin
72
- raw = YAML.load(File.read(self.config_file))
72
+ raw = YAML.load(ERB.new(File.read(self.config_file)).result)
73
73
  rescue
74
74
  raise Constancy::ConfigFileInvalid.new("Unable to parse config file as YAML")
75
75
  end
@@ -1,5 +1,5 @@
1
1
  # This software is public domain. No rights are reserved. See LICENSE for more information.
2
2
 
3
3
  class Constancy
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constancy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Adams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-14 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: imperium