producer-core 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/producer/core.rb +1 -0
- data/lib/producer/core/template.rb +4 -3
- data/lib/producer/core/template/raw_renderer.rb +13 -0
- data/lib/producer/core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5406aed7b9a963a2c33e10f8e626ab4d6152ebe7
|
4
|
+
data.tar.gz: 205d036044f1a2b1e2fe16157b1563e7ca6bd418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ab2e81b2df439731b19aaae798b7784fee379cd4f51b3bf091dc6fa816b37657c4be579045c68edd662975021b4f3ed83865c34f8aa982196da09664690b7f1
|
7
|
+
data.tar.gz: 835d3b85896352b81d1fe3ed9c3320734f43e655dd8c2f11f3da2e292ffdecb719e3c57d43c702bf254fd177f3b5098032945e46ee8c91fddaa62857f892c4fd
|
data/lib/producer/core.rb
CHANGED
@@ -46,6 +46,7 @@ require 'producer/core/remote/environment'
|
|
46
46
|
require 'producer/core/remote/fs'
|
47
47
|
require 'producer/core/task'
|
48
48
|
require 'producer/core/template/erb_renderer'
|
49
|
+
require 'producer/core/template/raw_renderer'
|
49
50
|
require 'producer/core/template/yaml_renderer'
|
50
51
|
require 'producer/core/template'
|
51
52
|
require 'producer/core/version'
|
@@ -3,8 +3,9 @@ module Producer
|
|
3
3
|
class Template
|
4
4
|
SEARCH_PATH = 'templates'.freeze
|
5
5
|
RENDERERS = {
|
6
|
-
|
7
|
-
|
6
|
+
/\.erb\z/ => ERBRenderer,
|
7
|
+
/\.yaml\z/ => YAMLRenderer,
|
8
|
+
// => RawRenderer
|
8
9
|
}.freeze
|
9
10
|
|
10
11
|
def initialize path, search_path: SEARCH_PATH, renderers: RENDERERS
|
@@ -15,7 +16,7 @@ module Producer
|
|
15
16
|
|
16
17
|
def render variables = {}
|
17
18
|
candidates.each do |c|
|
18
|
-
|
19
|
+
_, r = @renderers.find { |k, _| c.to_s =~ k }
|
19
20
|
return r.render c, variables if r
|
20
21
|
end
|
21
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/producer/core/task.rb
|
157
157
|
- lib/producer/core/template.rb
|
158
158
|
- lib/producer/core/template/erb_renderer.rb
|
159
|
+
- lib/producer/core/template/raw_renderer.rb
|
159
160
|
- lib/producer/core/template/yaml_renderer.rb
|
160
161
|
- lib/producer/core/test.rb
|
161
162
|
- lib/producer/core/testing.rb
|