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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c604445bb1362ae82eee81874dcac8f1554508b
4
- data.tar.gz: 9f4631b23e2cc31dd6a417d56b9f785c96ac1c46
3
+ metadata.gz: 148e1fbc0202e6193d5bb251b1b001ebe073a06b
4
+ data.tar.gz: 00384b0347cc7727e433e68ca69ca585fb184401
5
5
  SHA512:
6
- metadata.gz: c7e79ad4f57f09adb78f65d8e81913595e784d2adbb2e96d7ab916f4ca420ba818557acb26b023a74a9f8f5d9ae6c5d4ac56c7e0640a206a55df1714034bab5a
7
- data.tar.gz: 89a628f5f9dd4ec35b34e681430c7bbf1e2f57e376f7b8cd2c03133eda48114aa6d94bb5d961039f8d08ad5e4373f48242631724d5b5f889a25a43487873e003
6
+ metadata.gz: 406a2f4ad18a361e651cdce005a0723654c6dc193e1b90fb4fab7acc204e743c3d71cbdf5de129c509827002805ec31add60df87eac79b031c6c9b2c925c1d32
7
+ data.tar.gz: f7a77507a2981a6fc62dbf4d16b07f3f46d3a180986c6761d6ccbcbaf64d55d721fbada085943c264f5bfe045150d075c80837aec2913bf49e3c3f5375b614ad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Usmu Change Log
2
2
 
3
+ ## 1.4.1
4
+
5
+ Matthew Scharley <matt.scharley@gmail.com>
6
+
7
+ * Add #render_content (94c5320d4c68bf864e6b01a351dc66631b317b3b)
8
+
3
9
  ## 1.4.0
4
10
 
5
11
  Matthew Scharley <matt.scharley@gmail.com>
@@ -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
- template_config = add_template_defaults((@configuration[provider_name] || {}).clone, provider_name)
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
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Usmu
3
3
  # The current version string for the gem
4
- VERSION = '1.4.0'
4
+ VERSION = '1.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usmu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Scharley