config_templates 1.1.2 → 1.1.3
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/config_templates/contexts/compilation.rb +8 -5
- data/lib/config_templates/contexts/rendering.rb +3 -3
- data/lib/config_templates/{directives → extensions}/include.rb +0 -0
- data/lib/config_templates/{directives → extensions}/invocation.rb +0 -0
- data/lib/config_templates/{directives → extensions}/stage.rb +0 -0
- data/lib/config_templates/version.rb +1 -1
- data/spec/templates_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97fc70c512563569519b377626daa1fed6184f16
|
4
|
+
data.tar.gz: 467a9ddc3ec1cdbf156933b6371c1e67705b0abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
23
|
-
|
24
|
-
|
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
|
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
|
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)
|
34
|
+
extension_class.new.call(self, invocation)
|
35
35
|
end
|
36
36
|
|
37
37
|
def respond_to_missing?(method_name)
|
File without changes
|
File without changes
|
File without changes
|
data/spec/templates_spec.rb
CHANGED
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.
|
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
|