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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a59bbda268d60668c1b0bff8dc1f37eefc3a834d
4
- data.tar.gz: 830f6e8ba0a452024d905679e3536f359476767b
3
+ metadata.gz: 5406aed7b9a963a2c33e10f8e626ab4d6152ebe7
4
+ data.tar.gz: 205d036044f1a2b1e2fe16157b1563e7ca6bd418
5
5
  SHA512:
6
- metadata.gz: 37113fab68f768445a648eb0c299aec71b07ec3f1be756195ce96dc711a62cb70759f29cbd9ae86f4fc7e1f4deccd4df5594e7ca585310656c7e279d1bd159fc
7
- data.tar.gz: 30ffac8b310c4a41ed49c97611f8eacab87401a59e02d7a54d72dc51beb5eaaaedb1abbede07c79f4a6822674e29579e09e79924b52cd709261754302368b3df
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
- ERBRenderer => %i[erb],
7
- YAMLRenderer => %i[yaml]
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
- r, * = @renderers.find { |_, v| v.include? c.extname[1..-1].to_sym }
19
+ _, r = @renderers.find { |k, _| c.to_s =~ k }
19
20
  return r.render c, variables if r
20
21
  end
21
22
 
@@ -0,0 +1,13 @@
1
+ module Producer
2
+ module Core
3
+ class Template
4
+ class RawRenderer
5
+ class << self
6
+ def render file_path, *_
7
+ File.read(file_path)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Core
3
- VERSION = '0.5.12'.freeze
3
+ VERSION = '0.5.13'.freeze
4
4
  end
5
5
  end
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.12
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-22 00:00:00.000000000 Z
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