puppet-strings 0.4.0 → 0.99.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +122 -0
  3. data/COMMITTERS.md +185 -0
  4. data/CONTRIBUTING.md +89 -0
  5. data/Gemfile +38 -0
  6. data/JSON.md +511 -0
  7. data/LICENSE +13 -0
  8. data/README.md +416 -0
  9. data/Rakefile +49 -0
  10. data/lib/puppet-strings.rb +63 -0
  11. data/lib/puppet-strings/json.rb +49 -0
  12. data/lib/puppet-strings/tasks.rb +10 -0
  13. data/lib/puppet-strings/tasks/generate.rb +23 -0
  14. data/lib/puppet-strings/tasks/gh_pages.rb +43 -0
  15. data/lib/puppet-strings/yard.rb +96 -0
  16. data/lib/puppet-strings/yard/code_objects.rb +8 -0
  17. data/lib/puppet-strings/yard/code_objects/base.rb +14 -0
  18. data/lib/puppet-strings/yard/code_objects/class.rb +59 -0
  19. data/lib/puppet-strings/yard/code_objects/defined_type.rb +58 -0
  20. data/lib/puppet-strings/yard/code_objects/function.rb +93 -0
  21. data/lib/puppet-strings/yard/code_objects/group.rb +30 -0
  22. data/lib/puppet-strings/yard/code_objects/provider.rb +93 -0
  23. data/lib/puppet-strings/yard/code_objects/type.rb +146 -0
  24. data/lib/puppet-strings/yard/handlers.rb +16 -0
  25. data/lib/puppet-strings/yard/handlers/puppet/base.rb +44 -0
  26. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +23 -0
  27. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +23 -0
  28. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +42 -0
  29. data/lib/puppet-strings/yard/handlers/ruby/base.rb +38 -0
  30. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +357 -0
  31. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +113 -0
  32. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +194 -0
  33. data/lib/puppet-strings/yard/parsers.rb +7 -0
  34. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +70 -0
  35. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +146 -0
  36. data/lib/puppet-strings/yard/tags.rb +6 -0
  37. data/lib/puppet-strings/yard/tags/overload_tag.rb +109 -0
  38. data/lib/puppet-strings/yard/tags/parameter_directive.rb +24 -0
  39. data/lib/puppet-strings/yard/tags/property_directive.rb +24 -0
  40. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_class.erb +9 -0
  41. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_defined_type.erb +9 -0
  42. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_function.erb +10 -0
  43. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb +10 -0
  44. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb +9 -0
  45. data/lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb +64 -0
  46. data/lib/puppet-strings/yard/templates/default/layout/html/objects.erb +35 -0
  47. data/lib/puppet-strings/yard/templates/default/layout/html/setup.rb +172 -0
  48. data/lib/puppet-strings/yard/templates/default/puppet_class/html/box_info.erb +26 -0
  49. data/lib/puppet-strings/yard/templates/default/puppet_class/html/header.erb +1 -0
  50. data/lib/puppet-strings/yard/templates/default/puppet_class/html/overview.erb +6 -0
  51. data/lib/puppet-strings/yard/templates/default/puppet_class/html/setup.rb +14 -0
  52. data/lib/puppet-strings/yard/templates/default/puppet_class/html/source.erb +12 -0
  53. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/box_info.erb +10 -0
  54. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/header.erb +1 -0
  55. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/overview.erb +6 -0
  56. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/setup.rb +5 -0
  57. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/source.erb +12 -0
  58. data/lib/puppet-strings/yard/templates/default/puppet_function/html/box_info.erb +14 -0
  59. data/lib/puppet-strings/yard/templates/default/puppet_function/html/header.erb +1 -0
  60. data/lib/puppet-strings/yard/templates/default/puppet_function/html/overview.erb +18 -0
  61. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +5 -0
  62. data/lib/puppet-strings/yard/templates/default/puppet_function/html/source.erb +12 -0
  63. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/box_info.erb +14 -0
  64. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/collection.erb +10 -0
  65. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/features.erb +12 -0
  66. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/header.erb +1 -0
  67. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/overview.erb +6 -0
  68. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/setup.rb +29 -0
  69. data/lib/puppet-strings/yard/templates/default/puppet_type/html/box_info.erb +20 -0
  70. data/lib/puppet-strings/yard/templates/default/puppet_type/html/features.erb +13 -0
  71. data/lib/puppet-strings/yard/templates/default/puppet_type/html/header.erb +1 -0
  72. data/lib/puppet-strings/yard/templates/default/puppet_type/html/overview.erb +6 -0
  73. data/lib/puppet-strings/yard/templates/default/puppet_type/html/parameters.erb +35 -0
  74. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +32 -0
  75. data/lib/puppet-strings/yard/templates/default/tags/html/puppet_overload.erb +12 -0
  76. data/lib/puppet-strings/yard/templates/default/tags/setup.rb +15 -0
  77. data/lib/puppet/application/strings.rb +1 -0
  78. data/lib/puppet/face/strings.rb +80 -39
  79. data/spec/acceptance/emit_json_options.rb +41 -0
  80. data/spec/acceptance/lib/util.rb +15 -0
  81. data/spec/acceptance/running_strings_generate.rb +54 -0
  82. data/spec/fixtures/acceptance/modules/test/functions/add.pp +9 -0
  83. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +5 -0
  84. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +2 -0
  85. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +9 -0
  86. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +15 -0
  87. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +27 -0
  88. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +27 -0
  89. data/spec/fixtures/acceptance/modules/test/metadata.json +6 -0
  90. data/spec/fixtures/unit/json/output.json +348 -0
  91. data/spec/fixtures/unit/json/output_without_puppet_function.json +301 -0
  92. data/spec/spec_helper.rb +21 -0
  93. data/spec/spec_helper_acceptance.rb +27 -0
  94. data/spec/unit/puppet-strings/json_spec.rb +136 -0
  95. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +155 -0
  96. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +155 -0
  97. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +169 -0
  98. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +613 -0
  99. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +90 -0
  100. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +214 -0
  101. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +171 -0
  102. metadata +115 -92
  103. data/lib/puppet-strings/rake_tasks.rb +0 -18
  104. data/lib/puppet_x/puppetlabs/strings.rb +0 -64
  105. data/lib/puppet_x/puppetlabs/strings/actions.rb +0 -92
  106. data/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb +0 -79
  107. data/lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb +0 -47
  108. data/lib/puppet_x/puppetlabs/strings/util.rb +0 -65
  109. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb +0 -33
  110. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb +0 -22
  111. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/method_object.rb +0 -62
  112. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb +0 -24
  113. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb +0 -48
  114. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb +0 -42
  115. data/lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb +0 -40
  116. data/lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb +0 -13
  117. data/lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb +0 -31
  118. data/lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb +0 -80
  119. data/lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb +0 -42
  120. data/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb +0 -95
  121. data/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb +0 -54
  122. data/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb +0 -234
  123. data/lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb +0 -295
  124. data/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb +0 -85
  125. data/lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb +0 -68
  126. data/lib/puppet_x/puppetlabs/strings/yard/parser.rb +0 -30
  127. data/lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb +0 -9
  128. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/docstring.erb +0 -34
  129. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/header.erb +0 -5
  130. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/parameter_details.erb +0 -6
  131. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/setup.rb +0 -1
  132. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb +0 -49
  133. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_class.erb +0 -2
  134. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb +0 -1
  135. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb +0 -21
  136. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb +0 -1
  137. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb +0 -1
  138. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb +0 -82
  139. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/box_info.erb +0 -22
  140. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/setup.rb +0 -1
  141. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/subclasses.erb +0 -4
  142. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/setup.rb +0 -21
  143. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/html_helper.rb +0 -139
  144. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/layout/html/setup.rb +0 -18
  145. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/html/header.erb +0 -17
  146. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb +0 -21
  147. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/text/header.erb +0 -2
  148. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/command_details.erb +0 -8
  149. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/confine_details.erb +0 -10
  150. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/default_details.erb +0 -10
  151. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/docstring.erb +0 -34
  152. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/feature_details.erb +0 -10
  153. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/header.erb +0 -5
  154. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/setup.rb +0 -1
  155. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/setup.rb +0 -50
  156. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/box_info.erb +0 -11
  157. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/header.erb +0 -5
  158. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb +0 -53
  159. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb +0 -20
  160. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/setup.rb +0 -1
  161. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb +0 -91
  162. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/template_helper.rb +0 -192
  163. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/docstring.erb +0 -34
  164. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/header.erb +0 -5
  165. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/parameter_details.erb +0 -12
  166. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/provider_details.erb +0 -10
  167. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/setup.rb +0 -1
  168. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/setup.rb +0 -55
@@ -1,21 +0,0 @@
1
- include T('default/definedtype')
2
-
3
- def init
4
- super
5
- sections.push :subclasses
6
- end
7
-
8
- def subclasses
9
- # The naming is a bit weird because Ruby classes use `globals.subclasses`.
10
- unless globals.hostsubclasses
11
- globals.hostsubclasses = {}
12
- list = run_verifier Registry.all(:hostclass)
13
- list.each {|o| (globals.hostsubclasses[o.parent_class.path] ||= []) << o if o.parent_class }
14
- end
15
-
16
- @subclasses = globals.hostsubclasses[object.path]
17
-
18
- return if @subclasses.nil? || @subclasses.empty?
19
- erb(:subclasses)
20
- end
21
-
@@ -1,139 +0,0 @@
1
- # A class containing helper methods to aid the generation of HTML
2
- # given formatted data
3
- class HTMLHelper
4
-
5
- # Generates the HTML to format the relevant data about return values
6
- def generate_return_types(types, desc = nil)
7
- result = []
8
-
9
- result << "(<span class=\"type\"><tt>" << types.join(", ") << "</tt></span>)"
10
-
11
- if !desc.nil?
12
- result << "- <div class=\"inline\"><p>#{desc}</p></div>"
13
- end
14
-
15
- result.join
16
- end
17
-
18
- def generate_features features, object
19
- result = []
20
-
21
- if features
22
- features.each do |feat|
23
- result << "<li>"
24
- result << "<span class=\"name\">#{feat[:name]} </span>"
25
- if feat[:desc]
26
- result << "- <br/><div class=\"inline\"><p> #{feat[:desc]} </p></div>"
27
- end
28
- if feat[:methods]
29
- result << "<h3> Methods </h3>"
30
- result << "<ul>"
31
- feat[:methods].each do |method|
32
- result << "<li> <tt>" << method << "</tt> </li>"
33
- end
34
- result << "</ul>"
35
- end
36
- result << "</li>"
37
- end
38
- end
39
- result.join
40
- end
41
-
42
- # Generates the HTML to format the relevant data about parameters
43
- def generate_parameters(params, object)
44
- result = []
45
-
46
- params.each do |param|
47
- result << "<li>"
48
-
49
- # Parameters which are documented in the comments but not
50
- # present in the code itself are given the strike through
51
- # styling in order to show the reader that they do not actually
52
- # exist
53
- if !param[:exists?]
54
- result << "<strike>"
55
- end
56
-
57
- result << "<span class=\"name\">#{param[:name]} </span>"
58
- result << "<span class=\"type\">"
59
-
60
- # If the docstring specifies types, use those
61
- if param[:types]
62
- result << "(" << "<tt>" << param[:types].join(", ") << "</tt>" << ")"
63
- # Otherwise, if typing information could be extracted from the object
64
- # itself, use that
65
- elsif object.type_info
66
- # If the parameter name includes the default value, scrub that.
67
- if param[:name].match(/([^=]*)=/)
68
- param_name = $1
69
- else
70
- param_name = param[:name]
71
- end
72
- # Collect all the possible types from the object. If no such type
73
- # exists for this parameter name don't do anything.
74
- possible_types = object.type_info.map {
75
- |sig| sig[param_name] or nil
76
- }.compact
77
-
78
- # If no possible types could be determined, put the type down as
79
- # Unknown
80
- if possible_types == []
81
- result << "(" << "<tt>Unknown</tt>" << ")"
82
- else
83
- result << "(" << "<tt>" << possible_types.join(", ") << "</tt>" << ")"
84
- end
85
- # Give up. It can probably be anything.
86
- elsif not (param[:puppet_3_func] or param[:puppet_type])
87
- result << "(<tt>Unknown</tt>)"
88
- end
89
- if param[:puppet_type] and param[:parameter]
90
- result << "(Parameter) "
91
- elsif param[:puppet_type] and param[:property]
92
- result << "(Property) "
93
- end
94
-
95
- if param[:namevar]
96
- result << "(Namevar) "
97
- end
98
- if param[:default]
99
- result << " Default value: <tt>" << param[:default] << "</tt> "
100
- end
101
-
102
- result << "</span>"
103
-
104
- # This is only relevant for manifests, not puppet functions
105
- # This is due to the fact that the scope of a parameter (as illustrated by
106
- # by it's fully qualified name) is not relevant for the parameters in puppet
107
- # functions, but may be for components of a manifest (i.e. classes)
108
- unless param[:fq_name].nil?
109
- result << "<tt> => #{param[:fq_name]}</tt>"
110
- end
111
-
112
- if param[:desc]
113
- result << " - <div class=\"inline\"><p> #{param[:desc]} </p></div>"
114
- end
115
-
116
- if !param[:exists?]
117
- result << "</strike>"
118
- end
119
-
120
- if param[:allowed_values] and param[:allowed_values] != []
121
- result << "\n<b> Allowed Values: </b>"
122
- result << "<ul>"
123
- param[:allowed_values].each do |value_thing|
124
- result << "<li>"
125
- result << "<tt>" << value_thing.first << "</tt>"
126
- if value_thing[1]
127
- result << " only available if " << "<tt>" << value_thing[1] << "</tt>"
128
- end
129
- result << "</li>"
130
- end
131
- result << "</ul>\n"
132
- end
133
-
134
- result << "</li>"
135
- end
136
-
137
- result.join
138
- end
139
- end
@@ -1,18 +0,0 @@
1
- # TODO: This should be extendable. However, the re-assignment of
2
- # @objects_by_letter prevents that. Submit a pull request.
3
- def index
4
- @objects_by_letter = {}
5
- objects = Registry.all(:class, :module, :type, :puppetnamespace, :hostclass, :definedtype, :provider).sort_by {|o| o.name.to_s }
6
- objects = run_verifier(objects)
7
- objects.each {|o| (@objects_by_letter[o.name.to_s[0,1].upcase] ||= []) << o }
8
- erb(:index)
9
- end
10
-
11
- def menu_lists
12
- [
13
- {:type => 'puppet_manifest', :title => 'Puppet Manifests', :search_title => "Puppet Manifest List"},
14
- {:type => 'puppet_plugin', :title => 'Puppet Plugins', :search_title => "Puppet Plugin List"},
15
- {:type => 'puppet_type', :title => 'Puppet Types', :search_title => "Puppet Type List"},
16
- {:type => 'puppet_provider', :title => 'Puppet Providers', :search_title => "Puppet Provider List"},
17
- ] + super
18
- end
@@ -1,17 +0,0 @@
1
- <h1>Method: <%= object.path %></h1>
2
- <div class="box_info">
3
- <dl>
4
- <dt class="">Defined in:</dt>
5
- <dd class="">
6
- <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
7
- <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></div>
8
- <% end %>
9
- </dd>
10
- </dl>
11
- </div>
12
-
13
- <div class="method_details_list">
14
- <div id="method_details">
15
- <%= yieldall :index => 0 %>
16
- </div>
17
- </div>
@@ -1,21 +0,0 @@
1
- include T('default/module')
2
- require File.join(File.dirname(__FILE__),'../html_helper')
3
- require File.join(File.dirname(__FILE__),'../template_helper')
4
-
5
- def init
6
- sections :header, [:method_signature, T('docstring'), :source]
7
- parents = YARD::Registry.all(:method).reject do |item|
8
- item.name == object.name and item.namespace === PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject
9
- end
10
- if parents.length == 0
11
- @template_helper = TemplateHelper.new
12
- @template_helper.check_parameters_match_docs object
13
- end
14
- end
15
-
16
- def source
17
- return if owner != object.namespace
18
- return if Tags::OverloadTag === object
19
- return if object.source.nil?
20
- erb(:source)
21
- end
@@ -1,8 +0,0 @@
1
- <h2>Commands Summary</h2>
2
- <div class="tags">
3
- <ul class="command">
4
- <% @command_details.each do |command| %>
5
- <li><tt><%= command %></tt></li>
6
- <% end %>
7
- </ul>
8
- </div>
@@ -1,10 +0,0 @@
1
- <h2>Confines</h2>
2
- <% if @confine_details != {} %>
3
- <div class="tags">
4
- <ul class="command">
5
- <% @confine_details.each_pair do |key, value| %>
6
- <li><tt><%= key %> - <%= value %></tt></li>
7
- <% end %>
8
- </ul>
9
- </div>
10
- <% end %>
@@ -1,10 +0,0 @@
1
- <h2>Defaults</h2>
2
- <% if @default_details != {} %>
3
- <div class="tags">
4
- <ul class="command">
5
- <% @default_details.each_pair do |key, value| %>
6
- <li><tt><%= key %> - <%= value %></tt></li>
7
- <% end %>
8
- </ul>
9
- </div>
10
- <% end %>
@@ -1,34 +0,0 @@
1
- <div class="docstring">
2
- <div class="discussion">
3
- <p><%= htmlify(Puppet::Util::Docs::scrub(@class_details[:desc])) %></p>
4
- </div>
5
- </div>
6
- <div class="tags">
7
- <% if @class_details[:examples] != {}%>
8
- <div class="examples">
9
- <p class="tag_title">Examples:</p>
10
- <% @class_details[:examples].each do |title, text| %>
11
- <div class="inline"><p><%= title %></p></div>
12
- <pre class="example code"><code><span><%= text %></span></code></pre>
13
- <% end %>
14
- </div>
15
- <% end %>
16
- <% if @class_details[:since] %>
17
- <p class="tag_title">Since:</p>
18
- <ul class="since">
19
- <li>
20
- <div class="inline">
21
- <p><%= @class_details[:since] %></p>
22
- </div>
23
- </li>
24
- </ul>
25
- <% end %>
26
- <% if @class_details[:return] %>
27
- <p class="tag_title">Return:</p>
28
- <ul class="return">
29
- <li>
30
- <%= @html_helper.generate_return_types(@class_details[:return][1], @class_details[:return][0]) %>
31
- </li>
32
- </ul>
33
- <% end %>
34
- </div>
@@ -1,10 +0,0 @@
1
- <h2>Features</h2>
2
- <% if @feature_details != [] %>
3
- <div class="tags">
4
- <ul class="command">
5
- <% @feature_details.each do |feature| %>
6
- <li><tt><%= feature %></tt></li>
7
- <% end %>
8
- </ul>
9
- </div>
10
- <% end %>
@@ -1,5 +0,0 @@
1
- <div class='module_header'>
2
- <h1>
3
- <%= @header_text %>
4
- </h1>
5
- </div>
@@ -1 +0,0 @@
1
- include T('default/module/html')
@@ -1,50 +0,0 @@
1
- include T('default/module')
2
-
3
- require File.join(File.dirname(__FILE__),'../html_helper')
4
- require File.join(File.dirname(__FILE__),'../template_helper')
5
-
6
- def init
7
- sections :header, :box_info, :pre_docstring, :docstring, :command_details, :confine_details, :default_details, :feature_details
8
-
9
- @template_helper = TemplateHelper.new
10
- @html_helper = HTMLHelper.new
11
- end
12
-
13
- def header
14
- @header_text = object.header_name
15
-
16
- erb(:header)
17
- end
18
-
19
- def command_details
20
- @command_details = object.commands
21
- erb(:command_details)
22
- end
23
-
24
- def confine_details
25
- @confine_details = object.confines
26
- erb(:confine_details)
27
- end
28
-
29
- def default_details
30
- @default_details = object.defaults
31
- erb(:default_details)
32
- end
33
-
34
- def feature_details
35
- @feature_details = object.features
36
- erb(:feature_details)
37
- end
38
-
39
- def header
40
- @header_text = "Puppet Provider: #{object.name}"
41
-
42
- erb(:header)
43
- end
44
-
45
- def docstring
46
-
47
- @class_details = @template_helper.extract_tag_data(object)
48
-
49
- erb(:docstring)
50
- end
@@ -1,11 +0,0 @@
1
- <dl class="box">
2
- <dt class="r1 last" style="height: 16px;">Defined in:</dt>
3
- <dd class="r1 last">
4
- <% @source_files.each do |file| %>
5
- <em><%= file[0] %></em>:
6
- <%= file[1] %>
7
- <br/>
8
- <% end %>
9
- </dd>
10
- </dl>
11
- <div class ="clear"></div>
@@ -1,5 +0,0 @@
1
- <div class='module_header'>
2
- <h1>
3
- <%= @header_text %>
4
- </h1>
5
- </div>
@@ -1,53 +0,0 @@
1
- <h2>Function Details</h2>
2
- <% @class_details.each do |func| %>
3
- <h3 class="signature" id = <%= "#{func[:name]}-instance_method" %>>
4
- <strong>
5
- <% if func[:return] %>
6
- <%= @html_helper.generate_return_types(func[:return][1]) %>
7
- <% end %>
8
- <%= func[:name] %>
9
- </strong>
10
- </h3>
11
- <div class="docstring">
12
- <div class="discussion">
13
- <p><%= htmlify(func[:desc]) %></p>
14
- </div>
15
- </div>
16
- <div class="tags">
17
- <% if func[:examples] != {}%>
18
- <div class="examples">
19
- <p class="tag_title">Examples:</p>
20
- <% func[:examples].each do |title, text| %>
21
- <div class="inline"><p><%= title %></p></div>
22
- <pre class="example code"><code><span><%= text %></span></code></pre>
23
- <% end %>
24
- </div>
25
- <% end %>
26
- <% if func[:since] %>
27
- <p class="tag_title">Since:</p>
28
- <ul class="since">
29
- <li>
30
- <div class="inline">
31
- <p><%= func[:since] %></p>
32
- </div>
33
- </li>
34
- </ul>
35
- <% end %>
36
- <% if func[:return] %>
37
- <p class="tag_title">Returns:</p>
38
- <ul class="return">
39
- <li>
40
- <%= @html_helper.generate_return_types(func[:return][1], func[:return][0]) %>
41
- </li>
42
- </ul>
43
- <% end %>
44
- <% if func[:params] != nil %>
45
- <p class="tag_title">Parameters:</p>
46
- <div class="tags">
47
- <ul class="param">
48
- <%= @html_helper.generate_parameters(func[:params], object.child) %>
49
- </ul>
50
- </div>
51
- <% end %>
52
- </div>
53
- <% end %>
@@ -1,20 +0,0 @@
1
- <h2>Available Functions</h2>
2
- <ul class="summary">
3
- <% @method_details.each do |method| %>
4
- <li class = "private">
5
- <span class = "summary_signature">
6
- <a href =<%= "##{method[:name]}-instance_method"%>>
7
- <% if ! method[:return_types].nil? %>
8
- <%= @html_helper.generate_return_types(method[:return_types]) %>
9
- <% end %>
10
- -
11
- <strong><%= method[:name] %></strong>
12
- </span>
13
- </li></a>
14
- <span class = "summary_desc">
15
- <div class = "inline">
16
- <p><%= method[:short_desc] %></p>
17
- </div>
18
- </span>
19
- <% end %>
20
- </ul>