@@ -31,23 +37,7 @@
Returns:
-
-
- <% if !func[:return][1].nil? %>
- (
- <% func[:return][1].each do |type| %>
- <%= type %>
- <% if func[:return][1].last != type %>
- ,
- <% end %>
- <% end %>
- ) —
- <% end %>
-
- <% if !func[:return][0].nil? %>
-
-
<%= func[:return][0] %>
-
- <% end %>
+ <%= @html_helper.generate_return_types(func[:return][1], func[:return][0]) %>
<% end %>
@@ -55,39 +45,7 @@
Parameters:
<% end %>
diff --git a/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb b/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb
index 6d61392..11ec619 100644
--- a/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb
+++ b/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb
@@ -4,18 +4,10 @@
>
-
<% if ! method[:return_types].nil? %>
- (
- <% method[:return_types].each do |type| %>
- <%= type %>
- <% if method[:return_types].last != type %>
- ,
- <% end %>
- <% end %>
- ) —
+ <%= @html_helper.generate_return_types(method[:return_types]) %>
<% end %>
-
+ -
<%= method[:name] %>
diff --git a/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb b/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb
index a310566..84ee82f 100644
--- a/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb
+++ b/lib/puppetx/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb
@@ -1,9 +1,11 @@
include T('default/module')
+require File.join(File.dirname(__FILE__),'../html_helper')
+
def init
sections :header, :box_info, :pre_docstring, T('docstring'),
:method_summary, [:item_summary],
- :method_details_list, :method_details
+ :method_details_list, [T('method_details')]
@methods = object.children
end
@@ -34,6 +36,7 @@ end
def method_summary
@method_details = []
+ @html_helper = HTMLHelper.new
@methods.each do |method|
# If there are multiple sentences in the method description, only
@@ -51,8 +54,9 @@ def method_summary
erb(:method_summary)
end
-def method_details
+def method_details_list
@class_details = []
+ @html_helper = HTMLHelper.new
@methods.each do |object|
examples = Hash.new
@@ -122,3 +126,4 @@ def extract_param_details(params_array, tags_hash)
parameter_info
end
+