dply 0.3.4 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1977ebe3a85d14aa607bbe886439ac8fd914a9a5622455604de86dc5a92ce9c
4
- data.tar.gz: 8820cbf3a600d4c64d604fbcb1318a7c3bf65dc75337dd008bc9b387c665ad26
3
+ metadata.gz: e203341fece647c82c802f342a9ebef4e2db491710360299e12d42f46ecf17e1
4
+ data.tar.gz: 81a8074a486df4e6b90184f36459b83374c81182ad484c0f51545dba7ed3b3c1
5
5
  SHA512:
6
- metadata.gz: 7c01d534aa672ed1558f6999606e073ac7660b1504eefa0c902460a28e6362d7af43a32a63602e26e3b24d3a1466030c7c9c8b777ce4809fa261cb4a2f4eb167
7
- data.tar.gz: be4e873ffbf2a109a44212313bfde650dbf04fb686c983cb14d87a18c2f41c4d2657e051c36113f358afb0190ce50962c0a07da24fa1543ed43c1ef8bb5bb1ef
6
+ metadata.gz: b688833f47f5908d747aaf8b56f107070722591015fadf9f9a2a5aae2ee2bad3afc53799790ccaed05ff9cfe1e2292bedc5e9c308ec3b61e2db6e5843e99e19e
7
+ data.tar.gz: d5a97127ed3557379f1228542b9114af34c887db800689663caf69315962122def05a64d24327aa3578af523e5aa01311176d374c4366a59e789b3f9542313d9
@@ -38,13 +38,19 @@ module Dply
38
38
  end
39
39
 
40
40
  def render_config
41
+ require 'json'
41
42
  load_config
42
43
  config_data = load_yml "meta.yml", optional: true
43
44
  tmp_file = "tmp/config_render.tmp"
45
+ config = lambda do |key|
46
+ value = config_data.dig(*key.split('.'))
47
+ raise "key #{key} not defined" if value.nil?
48
+ JSON.dump(value)
49
+ end
44
50
  @config_map.each do |dest, src|
45
51
  raise Error, %(error dest "#{dest}" is a directory) if File.directory? dest
46
52
  template = File.read "dply/config/#{src}"
47
- contents = ERB.new(template).result_with_hash(config_data)
53
+ contents = ERB.new(template).result(binding)
48
54
  File.write tmp_file, contents
49
55
  FileUtils.mv tmp_file, dest
50
56
  end
data/lib/dply/build.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'dply/helper'
2
2
  require 'dply/setup'
3
- require 'dply/config_downloader'
4
3
  require 'dply/yum'
5
4
  require 'dply/util'
6
5
  require 'forwardable'
data/lib/dply/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dply
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -72,7 +72,7 @@ describe "git flow" do
72
72
  Dir.chdir @deploy_dir do
73
73
  expect(File).to exist("current/test.txt")
74
74
  data = File.read "current/test.txt"
75
- expect(data).to eq("custom-host\napp-port\n")
75
+ expect(data).to eq("\"custom-host\"\n5432\n")
76
76
  end
77
77
  end
78
78
  end
@@ -1,7 +1,7 @@
1
1
  secret: app-value
2
2
  db:
3
3
  host: app-host
4
- port: app-port
4
+ port: 5432
5
5
  sv:
6
6
  a: 1
7
7
  b: 2
@@ -1,2 +1,2 @@
1
- <%= db.fetch("host") %>
2
- <%= db.fetch("port") %>
1
+ <%= config["db.host"] %>
2
+ <%= config["db.port"] %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj