semi 0.3.2 → 0.3.3

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: 5ddcfc2b2c39716b3545162f16871750194bd3b4
4
- data.tar.gz: 9256ddba7ee653ec38f3d7b5f0be59b9353efa42
3
+ metadata.gz: 60f7b3709ae388fbca46439b4eb751f5393c1188
4
+ data.tar.gz: 98495dcaa1f7b8d6e2b598415c0cd2da3e149b7d
5
5
  SHA512:
6
- metadata.gz: 3e59adc27e9693d872d224173daba47be734a609ae5a6679d3b0dc205fd7481cdc7bd69df93e56d80a88fae573ccdadda76f96b4359c3edfe70c017f210d293f
7
- data.tar.gz: f6c8f58b7371a8a928740664036309e74a653929c61e99a6df247a3d354555147ad4bb24cf9788c62bffbeec5ce73194a10e9253aa745b00e7143b25bbfff79a
6
+ metadata.gz: f53f6464cb5279c899693a3329801281f677598e462237080839b184d923680d597ebd6e3011a8a4603a7f7981fddd0f24e9412a6ba9d9c612198622be3860e7
7
+ data.tar.gz: 2df03e469ef11dc22c35c314068c127c091eff7d976d106edf555770722f758bbfd75c4bcfcaa47c9fb72054aae82af0081009a3fbae8ce7184b67e25767fe5a
data/lib/semi/driver.rb CHANGED
@@ -9,14 +9,16 @@ module Semi
9
9
  end
10
10
 
11
11
  def start
12
- # Merge defaults into the environment
12
+ # Initialize the dictionary with the defaults
13
13
  @dictionary = {}
14
14
  @config.defaults.each_pair do |name,val|
15
15
  @dictionary[name] = Semi::Variable.import(val)
16
16
  end
17
17
 
18
- puts "dictionary = #{@dictionary.inspect}"
19
- @dictionary.merge!(ENV.to_h)
18
+ # Now manually merge in the env vars
19
+ ENV.each_pair do |name, val|
20
+ @dictionary[name] = Semi::Variable.import(val)
21
+ end
20
22
 
21
23
  # Check any validations being asserted
22
24
  @config.validators.each_key { |key|
@@ -38,14 +40,16 @@ module Semi
38
40
  # Process the config files and generate final versions
39
41
  @config.files.each do |file|
40
42
  # Read the template file and render
41
- contents = File.open(file, 'r') do |fp|
42
- renderer = ERB.new(fp.readlines.join)
43
- renderer.result(@dictionary.instance_eval {binding})
44
- end
43
+ if File.exist? file
44
+ contents = File.open(file, 'r') do |fp|
45
+ renderer = ERB.new(fp.readlines.join)
46
+ renderer.result(@dictionary.instance_eval {binding})
47
+ end
45
48
 
46
- # Reopen the file and write the rendered contents
47
- File.open(file, 'w') do |fp|
48
- fp.write(contents)
49
+ # Reopen the file and write the rendered contents
50
+ File.open(file, 'w') do |fp|
51
+ fp.write(contents)
52
+ end
49
53
  end
50
54
  end
51
55
 
data/lib/semi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Semi
2
- version = '0.3.2'
2
+ version = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerard Hickey