dock0 0.2.8 → 0.2.9

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
  SHA1:
3
- metadata.gz: fdf9bc6daeac4608d4be65112d2044b90aa1c414
4
- data.tar.gz: 83d6b5a10c13ecec236aedfa7028302875b2343c
3
+ metadata.gz: 5bfcec4e9449bb947d140d9f5170c853347c72b2
4
+ data.tar.gz: 25330447a67a1a60655e9bc1e44161decd0c731e
5
5
  SHA512:
6
- metadata.gz: d5d5df6fe24aca80326639e2bf438cfec923d138c2dae7377cf1b863646eda64258d08f9b730aab01f570fd8e21d9d5fa186785312177394ca4c4df6232fa1c5
7
- data.tar.gz: 740e0a20c9268dfba88035267dc7e382275248d00ec35f9b8c8f91a57a4dfdebc21c700ee1c8fedfc611f5de755936a45d032bb8259a5d0618a7ccb9965f5108
6
+ metadata.gz: 9c1b3bd103eed81464c5e310d25877b053690f1df7ddcabf769c30a6833443874a260027bb0689a7a7bf4f59e02f4e2ef7f0ebf2a9bb5c08be9f611ad0b3ddcd
7
+ data.tar.gz: a38460650f598efa379ae7103369f506094b7893e468dfbead4dc0f254c77d36ffcbea60cb583e78e01fd2c89fb72a85f8c78a89592caeee472aef243f5fe797
data/lib/dock0.rb CHANGED
@@ -49,6 +49,24 @@ module Dock0
49
49
  fail "Failed running #{cmd}:\n#{results}"
50
50
  end
51
51
 
52
+ def templates
53
+ Dir.chdir(@paths['templates']) do
54
+ Dir.glob('**/*').select { |x| File.file? x }
55
+ end
56
+ end
57
+
58
+ def render_templates(prefix)
59
+ templates.each do |path|
60
+ puts "Templating #{path}"
61
+ template = File.read "#{@paths['templates']}/#{path}"
62
+ parsed = ERB.new(template, nil, '<>').result(binding)
63
+
64
+ target_path = "#{@paths['build']}/#{prefix}/#{path}"
65
+ FileUtils.mkdir_p File.dirname(target_path)
66
+ File.open(target_path, 'w') { |fh| fh.write parsed }
67
+ end
68
+ end
69
+
52
70
  def run_script(script)
53
71
  Dir.chdir('.') { instance_eval File.read(script), script, 0 }
54
72
  end
data/lib/dock0/config.rb CHANGED
@@ -16,24 +16,6 @@ module Dock0
16
16
  }
17
17
  end
18
18
 
19
- def templates
20
- Dir.chdir(@paths['templates']) do
21
- Dir.glob('**/*').select { |x| File.file? x }
22
- end
23
- end
24
-
25
- def render_templates
26
- templates.each do |path|
27
- puts "Templating #{path}"
28
- template = File.read "#{@paths['templates']}/#{path}"
29
- parsed = ERB.new(template, nil, '<>').result(binding)
30
-
31
- target_path = "#{@paths['build']}/templates/#{path}"
32
- FileUtils.mkdir_p File.dirname(target_path)
33
- File.open(target_path, 'w') { |fh| fh.write parsed }
34
- end
35
- end
36
-
37
19
  def finalize
38
20
  puts "Packing config into #{@paths['output']}"
39
21
  tar = Dir.chdir(File.dirname(@paths['build'])) do
@@ -44,7 +26,7 @@ module Dock0
44
26
 
45
27
  def easy_mode
46
28
  cleanup @paths.values_at('build', 'output')
47
- render_templates
29
+ render_templates('templates')
48
30
  run_scripts
49
31
  finalize
50
32
  cleanup @paths.values_at('build')
data/lib/dock0/install.rb CHANGED
@@ -11,10 +11,10 @@ module Dock0
11
11
  'templates' => './templates',
12
12
  'scripts' => './scripts',
13
13
  'build' => './build',
14
- 'base' => '/',
14
+ 'base' => '/'
15
15
  },
16
16
  'org' => 'dock0',
17
- 'artifacts' => [],
17
+ 'artifacts' => []
18
18
  }
19
19
  end
20
20
 
@@ -38,27 +38,9 @@ module Dock0
38
38
  end
39
39
  end
40
40
 
41
- def templates
42
- Dir.chdir(@paths['templates']) do
43
- Dir.glob('**/*').select { |x| File.file? x }
44
- end
45
- end
46
-
47
- def render_templates
48
- templates.each do |path|
49
- puts "Templating #{path}"
50
- template = File.read "#{@paths['templates']}/#{path}"
51
- parsed = ERB.new(template, nil, '<>').result(binding)
52
-
53
- target_path = "#{@paths['build']}/#{path}"
54
- FileUtils.mkdir_p File.dirname(target_path)
55
- File.open(target_path, 'w') { |fh| fh.write parsed }
56
- end
57
- end
58
-
59
41
  def easy_mode
60
42
  load_artifacts
61
- render_templates
43
+ render_templates('')
62
44
  run_scripts
63
45
  end
64
46
  end
data/lib/dock0/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Set the version (needed for Mercenary -v)
3
3
  module Dock0
4
- VERSION = '0.2.8'
4
+ VERSION = '0.2.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dock0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-13 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary