docker_toolkit 0.1.11 → 0.1.12

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
  SHA256:
3
- metadata.gz: 89498fef4e7f0fe036bda0ef1d2bcfc7ebc9d96f99d85736d401d853fb11aae1
4
- data.tar.gz: 2ebd100ebd81a0f5884f751c30f1c3f72d6e3721a77b0166a4b11c21fa900beb
3
+ metadata.gz: d16607a50a2e8821a42816dcf9793576c67858acc80dcd99ae45a5240a43c1e1
4
+ data.tar.gz: 93efc51ea006962e6af5c9cc17f806b69b6e95a00c3c81907cc306db22558c3f
5
5
  SHA512:
6
- metadata.gz: 58210e8c115647dc36c6b252160b2b26715d136d201251f96e5eef43d638a3989bce2a16faf030784b694c4848727ac4309b88e75d171b771a597acb52d0a56d
7
- data.tar.gz: 97a2e262e932825219cbfbb3fe00808b1371d1798608d92a5feb4c689ad3d53b097c3219a54f64ed10388362d70d3f01fa25c2f52907c1272de24ff4453dad0e
6
+ metadata.gz: 3bd5eed066256cb59744381a5ddef6e0b4a6936561c7b2e91201abacb10865f92c06889de54e6d481b3b36c10e67ceb182da3aee777be3237f2b8d353168b95a
7
+ data.tar.gz: f82e50fa54fa61268249f8c186984951a586bf57c35ce36ba0f314308075458dc18a82e9bc63c9b9fceb4cbfe3177273b76b800405aa2c6e9871d7d5f65010bf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docker_toolkit (0.1.11)
4
+ docker_toolkit (0.1.12)
5
5
  diplomat
6
6
  dotenv
7
7
  json
@@ -37,6 +37,24 @@ module DockerToolkit
37
37
  env[key]
38
38
  end
39
39
 
40
+ def envsubst *paths
41
+ paths = paths.flatten.map{|c| c.to_s.strip}.reject(&:empty?)
42
+ paths.each do |path|
43
+ Dir.glob("#{path}/**/*.in") do |templ|
44
+ output = templ.sub(/\.in$/, '')
45
+ cmd = "cat '#{templ}' | envsubst > '#{output}'"
46
+ system(cmd) || die("envsubst failed: #{cmd}")
47
+ end
48
+ end
49
+ end
50
+
51
+ def envsubst_file templ, output = nil
52
+ output ||= templ.sub(/\.in$/, '')
53
+ die("filename must ends with .in or output must be provided") if output.strip == templ.strip
54
+ cmd = "cat '#{templ}' | envsubst > '#{output}'"
55
+ system(cmd) || die("envsubst failed: #{cmd}")
56
+ end
57
+
40
58
  end
41
59
 
42
60
  end
@@ -1,5 +1,5 @@
1
1
  module DockerToolkit
2
2
 
3
- VERSION = '0.1.11'.freeze
3
+ VERSION = '0.1.12'.freeze
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan