constancy 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +8 -17
- data/README.md +19 -0
- data/lib/constancy.rb +1 -0
- data/lib/constancy/config.rb +1 -1
- data/lib/constancy/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: 7f2b5ae0525b88e9fc9b56f9d5bdcd4d84c143a3
|
|
4
|
+
data.tar.gz: 6350e6dec7a606733ba292e002bc423dff8634af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 213832240c59baf7d8289a27cc5829d66c7cc6e61a072eaf9a25b20d54d6929f21c8b85a76ac6c0f76cd704dbe180d21a30e0d1adc58564f3d964d58f15e80b7
|
|
7
|
+
data.tar.gz: c013397a8786af4f9f309a80217440b069c0459f7d71a8c072d1de34c366abbc2f2e4f2c69a31f960f560589e2c681bbe291e40310ff37cf2bba426913661093
|
data/LICENSE
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
This work is dedicated to the public domain. No rights reserved.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
I, the copyright holder of this work, hereby release it into the public
|
|
4
|
+
domain. This applies worldwide.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
13
|
-
|
|
9
|
+
If you require a fuller legal statement, please refer to the Creative
|
|
10
|
+
Commons Zero license:
|
|
14
11
|
|
|
15
|
-
|
|
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:
|
data/lib/constancy.rb
CHANGED
data/lib/constancy/config.rb
CHANGED
|
@@ -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
|
data/lib/constancy/version.rb
CHANGED
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
|
+
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-
|
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: imperium
|