config_templates 1.1.2 → 1.1.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: 2819660249db42a27e0a885f569a1a9cd94f8d44
4
- data.tar.gz: ea65ab18c2b310e9dabeba9f515037bc501dd5cc
3
+ metadata.gz: 97fc70c512563569519b377626daa1fed6184f16
4
+ data.tar.gz: 467a9ddc3ec1cdbf156933b6371c1e67705b0abd
5
5
  SHA512:
6
- metadata.gz: c110fccc3f5ddddf266a0de407ca7fd36cd6e2c2a5c92d5da5891b6822b774e39e8cbc9c838b425a5e932d3a67af17d3e16a6ca6e5192f1519bc7eab0dcbe353
7
- data.tar.gz: e857341a1314ff40eddea158e5f9a7d6c7a0e08999b5d7687bd8bf8647ef0a0e226f9b3bd1b19c363a505cf964b9dd824f06ef81ad128e49d9b663ac5322c9ff
6
+ metadata.gz: 2c0739c8619d47b979fc00486aeea1fc6f9646cef9026fc9376b3934670193dbc749d072aeede38c3db2729e84bf36b563bfe14ce8fd6552004133e602e55471
7
+ data.tar.gz: b66806f532521f416d3e32e788a9404edb8b6ce0f9f80a446667a58f702c827e283581d2bf0af546bf69b5d22291facad8137b07183b4e84e09d29a8bf6676a1
@@ -19,18 +19,21 @@ module ConfigTemplates::Contexts
19
19
 
20
20
  def components
21
21
  ::ConfigTemplates::Collections::Components.new(@criteria).tap do |collection|
22
- context = ::ConfigTemplates::Contexts::Rendering.new
23
- context.components = collection
24
- @templates.find_all.each { |template| collection << component(template, context) }
22
+ @templates.find_all.each do |template|
23
+ context = ::ConfigTemplates::Contexts::Rendering.new
24
+ context.components = collection
25
+ collection << component(template, collection, context)
26
+ end
25
27
  end
26
28
  end
27
29
 
28
30
  private
29
31
 
30
- def component(template, context)
32
+ def component(template, components, context)
31
33
  validator = @validators.find_by_file_name template.source_path
32
34
  engine = @engines.find_by_extension template.extension
33
- ::ConfigTemplates::Models::Component.new template, context, validator, engine
35
+ component = ::ConfigTemplates::Models::Component.new(template, context, validator, engine)
36
+ context.component = component
34
37
  end
35
38
  end
36
39
  end
@@ -6,7 +6,7 @@ module ConfigTemplates::Contexts
6
6
  'config'
7
7
  ]
8
8
 
9
- attr_accessor :components
9
+ attr_accessor :components, :component
10
10
 
11
11
  def initialize(extensions, settings, config)
12
12
  @extensions = extensions
@@ -29,9 +29,9 @@ module ConfigTemplates::Contexts
29
29
  end
30
30
 
31
31
  def method_missing(method_name, *args, &block)
32
- extension_class = @extensions.find_by_name method_name
32
+ extension_class = @extensions.find_by_name(method_name) || super
33
33
  invocation = ::ConfigTemplates::Extensions::Invocation.new method_name, args, block
34
- extension_class.new.call(self, invocation) rescue super
34
+ extension_class.new.call(self, invocation)
35
35
  end
36
36
 
37
37
  def respond_to_missing?(method_name)
@@ -1,3 +1,3 @@
1
1
  module ConfigTemplates
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'config_templates'
2
2
  require 'spec_helper'
3
3
 
4
- RSpec.describe ::ConfigTemplates do
4
+ RSpec.describe ::ConfigTemplates::Models::Compilation do
5
5
  before(:all) do
6
6
  @output = ::Mocks::Outputs::Test.new
7
7
  @validator = ::Mocks::Validators::Test.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - g.ivanov
@@ -130,12 +130,12 @@ files:
130
130
  - lib/config_templates/criteria/composite.rb
131
131
  - lib/config_templates/criteria/name.rb
132
132
  - lib/config_templates/criteria/path.rb
133
- - lib/config_templates/directives/include.rb
134
- - lib/config_templates/directives/invocation.rb
135
- - lib/config_templates/directives/stage.rb
136
133
  - lib/config_templates/engines/erb.rb
137
134
  - lib/config_templates/engines/text.rb
138
135
  - lib/config_templates/errors.rb
136
+ - lib/config_templates/extensions/include.rb
137
+ - lib/config_templates/extensions/invocation.rb
138
+ - lib/config_templates/extensions/stage.rb
139
139
  - lib/config_templates/filesystem/locator.rb
140
140
  - lib/config_templates/models/compilation.rb
141
141
  - lib/config_templates/models/component.rb