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 +4 -4
- data/lib/dock0.rb +18 -0
- data/lib/dock0/config.rb +1 -19
- data/lib/dock0/install.rb +3 -21
- data/lib/dock0/version.rb +1 -1
- 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: 5bfcec4e9449bb947d140d9f5170c853347c72b2
|
4
|
+
data.tar.gz: 25330447a67a1a60655e9bc1e44161decd0c731e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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-
|
11
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|