build-cloud 0.0.13 → 0.0.14
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.txt +1 -1
- data/README.md +2 -0
- data/build-cloud.gemspec +1 -1
- data/lib/build-cloud.rb +10 -9
- 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: fd4a20e8b7908bb629714238bea43885797a144d
|
4
|
+
data.tar.gz: f135d4406e2aa8f7e3577b420ad094371c493623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 049623b921bbe636b52a4db50db8b4d1a3f16ea7ead93afe6b987ecf5d5fb5ef017c1eec9e2b54e372acb30aa07f61daca7f64fe475c255ee7976d56978e5e7e
|
7
|
+
data.tar.gz: 66fb3c83ea5eec6490805e900fe59a2bda165d36c5d67c2304e2e08c974b214a9930486e1e7343c8f3ccd8148010d0bc2cf687ce130090703d7d1140b81a4072
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,8 @@ See the command line help for `build-cloud`.
|
|
22
22
|
|
23
23
|
## Changelog
|
24
24
|
|
25
|
+
2015-10-12 - version 0.0.14 - now allows defaults in interpolated variables, if the variable doesn't exist. Format is `%{variablename||default}` eg. `%{node_instance_type||t2.large}`
|
26
|
+
|
25
27
|
2015-09-02 - version 0.0.13 - use the same environment variables as AWS SDKs for credentials
|
26
28
|
|
27
29
|
2015-08-24 - version 0.0.12 - adds support for tagging network interfaces, permits multiple config files to be passed on the commandline, fixes a bug with S3 buckets named to contain dots.
|
data/build-cloud.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "build-cloud"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.14"
|
8
8
|
spec.authors = ["The Scale Factory"]
|
9
9
|
spec.email = ["info@scalefactory.com"]
|
10
10
|
spec.summary = %q{Tools for building resources in AWS}
|
data/lib/build-cloud.rb
CHANGED
@@ -207,6 +207,9 @@ class BuildCloud
|
|
207
207
|
# Work through the given config replacing all strings matching
|
208
208
|
# %{..x..} by looking up ..x.. in the existing @config hash and
|
209
209
|
# substituting the template with the value
|
210
|
+
#
|
211
|
+
# If ..x.. is of the form variable||default, if the given key is
|
212
|
+
# not defined anywhere, the default will be used.
|
210
213
|
|
211
214
|
case h
|
212
215
|
when Hash
|
@@ -219,17 +222,15 @@ class BuildCloud
|
|
219
222
|
h.map { |v| recursive_interpolate_config(v) }
|
220
223
|
when String
|
221
224
|
|
222
|
-
while
|
223
|
-
var = $1
|
224
|
-
val = ""
|
225
|
+
while /%\{(?<var>[^\|\}]*)(?:\|{2}(?<default>[^\}]*))?\}/ =~ h
|
225
226
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
227
|
+
# $& is the whole matched expression above, $MATCH when using English
|
228
|
+
exp = $&
|
229
|
+
|
230
|
+
val = @config.fetch(var.to_sym, default)
|
231
|
+
raise "Attempt to interpolate with non-existant key '#{var}' with no default value set" if val.nil?
|
231
232
|
|
232
|
-
h.gsub!(
|
233
|
+
h.gsub!(exp, val)
|
233
234
|
|
234
235
|
end
|
235
236
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Scale Factory
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|