usmu 1.4.0 → 1.4.1
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/CHANGELOG.md +6 -0
- data/lib/usmu/template/layout.rb +11 -4
- data/lib/usmu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148e1fbc0202e6193d5bb251b1b001ebe073a06b
|
4
|
+
data.tar.gz: 00384b0347cc7727e433e68ca69ca585fb184401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406a2f4ad18a361e651cdce005a0723654c6dc193e1b90fb4fab7acc204e743c3d71cbdf5de129c509827002805ec31add60df87eac79b031c6c9b2c925c1d32
|
7
|
+
data.tar.gz: f7a77507a2981a6fc62dbf4d16b07f3f46d3a180986c6761d6ccbcbaf64d55d721fbada085943c264f5bfe045150d075c80837aec2913bf49e3c3f5375b614ad
|
data/CHANGELOG.md
CHANGED
data/lib/usmu/template/layout.rb
CHANGED
@@ -66,12 +66,10 @@ module Usmu
|
|
66
66
|
# @param variables [Hash] Variables to be used in the template.
|
67
67
|
# @return [String] The rendered file.
|
68
68
|
def render(variables = {})
|
69
|
-
|
70
|
-
content = template_class.new("#{@name}", 1, template_config) { @content }.
|
71
|
-
render(helpers, get_variables(variables))
|
72
|
-
|
69
|
+
content = render_content(variables)
|
73
70
|
has_cr = content.index("\r")
|
74
71
|
content += (has_cr ? "\r\n" : "\n") if content[-1] != "\n"
|
72
|
+
|
75
73
|
if @parent.nil?
|
76
74
|
content
|
77
75
|
else
|
@@ -79,6 +77,15 @@ module Usmu
|
|
79
77
|
end
|
80
78
|
end
|
81
79
|
|
80
|
+
# Renders the internal content of the file with any templating language required and returns the result
|
81
|
+
#
|
82
|
+
# @param variables [Hash] Variables to be used in the template.
|
83
|
+
# @return [String] The rendered content.
|
84
|
+
def render_content(variables)
|
85
|
+
template_config = add_template_defaults((@configuration[provider_name] || {}).clone, provider_name)
|
86
|
+
template_class.new("#{@name}", 1, template_config) { @content }.render(helpers, get_variables(variables))
|
87
|
+
end
|
88
|
+
|
82
89
|
# @!attribute [r] input_path
|
83
90
|
# @return [String] the full path to the file in the source directory
|
84
91
|
def input_path
|
data/lib/usmu/version.rb
CHANGED