nasldoc 0.1.1 → 0.2.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 +15 -0
- data/Gemfile +5 -0
- data/Gemfile.ci +5 -0
- data/Gemfile.lock +17 -0
- data/LICENSE +1 -1
- data/NEWS.markdown +16 -1
- data/Rakefile +19 -19
- data/TODO.markdown +6 -8
- data/bin/nasldoc +20 -19
- data/lib/nasldoc.rb +21 -20
- data/lib/nasldoc/cli.rb +19 -19
- data/lib/nasldoc/cli/application.rb +43 -21
- data/lib/nasldoc/cli/application.rb.orig +290 -0
- data/lib/nasldoc/cli/application.rb.rej +16 -0
- data/lib/nasldoc/cli/comment.rb +19 -19
- data/lib/nasldoc/templates/file.erb +8 -6
- data/lib/nasldoc/templates/index.erb +1 -1
- data/nasldoc.gemspec +25 -22
- metadata +68 -22
- data/lib/nasldoc/templates/old/file.erb +0 -332
- data/lib/nasldoc/templates/old/xfile.erb +0 -267
- data/lib/nasldoc/templates/old/xindex.erb +0 -16
- data/lib/nasldoc/templates/old/xoverview.erb +0 -26
- data/lib/nasldoc/templates/old/xsidebar.erb +0 -21
- data/lib/nasldoc/templates/xindex.erb +0 -16
@@ -1,267 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
def comment(name, type)
|
3
|
-
filter1 = proc { |c| c.type == type }
|
4
|
-
|
5
|
-
filter2 = case type
|
6
|
-
when :export, :function
|
7
|
-
Proc.new { |c| c.function == name }
|
8
|
-
when :file
|
9
|
-
Proc.new { |c| true }
|
10
|
-
when :global
|
11
|
-
Proc.new { |c| c.variables.include? name }
|
12
|
-
end
|
13
|
-
|
14
|
-
@comments.select(&filter1).select(&filter2).shift
|
15
|
-
end
|
16
|
-
%>
|
17
|
-
|
18
|
-
<%
|
19
|
-
def safe(obj, default, *attrs)
|
20
|
-
attrs.each do |attr|
|
21
|
-
return default unless obj.respond_to? attr
|
22
|
-
obj = obj.send(attr)
|
23
|
-
end
|
24
|
-
|
25
|
-
obj
|
26
|
-
end
|
27
|
-
%>
|
28
|
-
|
29
|
-
<html>
|
30
|
-
<head>
|
31
|
-
<title><%= @current_file %></title>
|
32
|
-
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
|
33
|
-
</head>
|
34
|
-
<body>
|
35
|
-
<div id="content">
|
36
|
-
<a name="top"></a>
|
37
|
-
<h1>Overview of <%= @current_file %></h1>
|
38
|
-
<% unless @overview.nil? %>
|
39
|
-
<% unless @overview.summary.nil? %>
|
40
|
-
<p class="summary"><%= @overview.summary %></p>
|
41
|
-
<% end %>
|
42
|
-
<% @overview.description.each do |paragraph| %>
|
43
|
-
<p class="description"><%= paragraph %></p>
|
44
|
-
<% end %>
|
45
|
-
|
46
|
-
<% if @overview.signed %>
|
47
|
-
<h1>Signed</h1>
|
48
|
-
<p>This library contains a signature, indicating that it is permitted to
|
49
|
-
call trusted builtin functions.</p>
|
50
|
-
<p class="warning">The signature on this library has not been checked, so
|
51
|
-
there is no guarantee it will run in Nessus.</p>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
<% unless @overview.includes.empty? %>
|
55
|
-
<h1>Required Includes</h1>
|
56
|
-
<p>These files must be included by the importing code.</p>
|
57
|
-
<ul>
|
58
|
-
<% @overview.includes.sort.each do |inc| %>
|
59
|
-
<li><a href="<%= url(inc) %>"><%= inc %></a></li>
|
60
|
-
<% end %>
|
61
|
-
</ul>
|
62
|
-
<% end %>
|
63
|
-
<% end %>
|
64
|
-
|
65
|
-
<% unless @includes.empty? %>
|
66
|
-
<h1>Automatic Includes</h1>
|
67
|
-
<p>These files are automatically included by the library.</p>
|
68
|
-
<ul>
|
69
|
-
<% @includes.sort.each do |inc| %>
|
70
|
-
<li><a href="<%= url(inc) %>"><%= inc %></a></li>
|
71
|
-
<% end %>
|
72
|
-
</ul>
|
73
|
-
<% end %>
|
74
|
-
|
75
|
-
<% {Public: @globs_pub, Private: @globs_prv}.each do |name, list| %>
|
76
|
-
<% unless list.empty? %>
|
77
|
-
<h1><%= name %> Variable Summary</h1>
|
78
|
-
|
79
|
-
<% if name == :Public %>
|
80
|
-
<p>Public variables are intended to be accessed by the code that imports
|
81
|
-
this library.</p>
|
82
|
-
<% else %>
|
83
|
-
<p>Private variables are not intended to be accessed by the code that
|
84
|
-
imports this library. There is no functional difference between private
|
85
|
-
and public variables, only convention, and they may be accessed as
|
86
|
-
normal. </p>
|
87
|
-
<% end %>
|
88
|
-
|
89
|
-
<table class="nopad">
|
90
|
-
<tr class="TableHeadingColor">
|
91
|
-
<th>Name</th>
|
92
|
-
<th>Summary</th>
|
93
|
-
</tr>
|
94
|
-
<% list.sort.each do |name| %>
|
95
|
-
<tr>
|
96
|
-
<td><a href="#<%= name %>"><%= name %></a></td>
|
97
|
-
<td><%= safe(comment(name, :global), "", :summary) %></td>
|
98
|
-
</tr>
|
99
|
-
<% end %>
|
100
|
-
</table>
|
101
|
-
<% end %>
|
102
|
-
<% end %>
|
103
|
-
|
104
|
-
<% {Public: @funcs_pub, Private: @funcs_prv}.each do |name, list| %>
|
105
|
-
<% unless list.empty? %>
|
106
|
-
<h1><%= name %> Function Summary</h1>
|
107
|
-
|
108
|
-
<% if name == :Public %>
|
109
|
-
<p>Public functions are intended to be called by the code that imports
|
110
|
-
this library.</p>
|
111
|
-
<% else %>
|
112
|
-
<p>Private functions are not intended to be called by the code that
|
113
|
-
imports this library. There is no functional difference between private
|
114
|
-
and public functions, only convention, and they may be called as
|
115
|
-
normal. </p>
|
116
|
-
<% end %>
|
117
|
-
|
118
|
-
<table class="nopad">
|
119
|
-
<tr class="TableHeadingColor">
|
120
|
-
<th>Name</th>
|
121
|
-
<th>Summary</th>
|
122
|
-
</tr>
|
123
|
-
<% list.keys.sort.each do |name| %>
|
124
|
-
<tr>
|
125
|
-
<td><a href="#<%= name %>"><%= name %></a></td>
|
126
|
-
<td><%= safe(comment(name, :function), "", :summary) %></td>
|
127
|
-
</tr>
|
128
|
-
<% end %>
|
129
|
-
</table>
|
130
|
-
<% end %>
|
131
|
-
<% end %>
|
132
|
-
|
133
|
-
<% {Public: @globs_pub, Private: @globs_prv}.each do |name, list| %>
|
134
|
-
<% unless list.empty? %>
|
135
|
-
<h1><%= name %> Variable Details</h1>
|
136
|
-
<% list.sort.each do |name| %>
|
137
|
-
<h2 id="<%= name %>"><%= name %></h2>
|
138
|
-
<% comm = comment(name, :global) %>
|
139
|
-
|
140
|
-
<% unless comm.nil? %>
|
141
|
-
<% unless comm.summary.nil? %>
|
142
|
-
<h3>Summary</h3>
|
143
|
-
<p class="summary"><%= comm.summary %></p>
|
144
|
-
<% end %>
|
145
|
-
|
146
|
-
<% unless comm.description.empty? %>
|
147
|
-
<h3>Description</h3>
|
148
|
-
<% comm.description.each do |para| %>
|
149
|
-
<p class="description"><%= para %></p>
|
150
|
-
<% end %>
|
151
|
-
<% end %>
|
152
|
-
|
153
|
-
<% unless comm.remarks.empty? %>
|
154
|
-
<h3>Remarks</h3>
|
155
|
-
<% comm.remarks.each do |rem| %>
|
156
|
-
<p class="remark"><%= rem %></p>
|
157
|
-
<% end %>
|
158
|
-
<% end %>
|
159
|
-
|
160
|
-
<% unless comm.deprecated.nil? %>
|
161
|
-
<h3>Deprecated</h3>
|
162
|
-
<p class="deprecated"><%= comm.deprecated %></p>
|
163
|
-
<% end %>
|
164
|
-
|
165
|
-
<% unless comm.nessus.nil? %>
|
166
|
-
<h3>Nessus Version</h3>
|
167
|
-
<p class="nessus"><%= comm.nessus %></p>
|
168
|
-
<% end %>
|
169
|
-
|
170
|
-
<% unless comm.categories.empty? %>
|
171
|
-
<h3>Categories</h3>
|
172
|
-
<ul>
|
173
|
-
<% comm.categories.sort.each do |cat| %>
|
174
|
-
<li><%= cat %></li>
|
175
|
-
<% end %>
|
176
|
-
</ul>
|
177
|
-
<% end %>
|
178
|
-
<% end %>
|
179
|
-
|
180
|
-
<a href="#top">top</a>
|
181
|
-
<hr>
|
182
|
-
<% end %>
|
183
|
-
<% end %>
|
184
|
-
<% end %>
|
185
|
-
|
186
|
-
<% {Public: @funcs_pub, Private: @funcs_prv}.each do |name, list| %>
|
187
|
-
<% unless list.empty? %>
|
188
|
-
<h1><%= name %> Function Details</h1>
|
189
|
-
<% list.keys.sort.each do |name| %>
|
190
|
-
<h2 id="<%= name %>"><%= name %></h2>
|
191
|
-
<% comm = comment(name, :function) %>
|
192
|
-
|
193
|
-
<% unless comm.nil? %>
|
194
|
-
<% unless comm.summary.nil? %>
|
195
|
-
<h3>Summary</h3>
|
196
|
-
<p class="summary"><%= comm.summary %></p>
|
197
|
-
<% end %>
|
198
|
-
|
199
|
-
<% unless comm.description.empty? %>
|
200
|
-
<h3>Description</h3>
|
201
|
-
<% comm.description.each do |para| %>
|
202
|
-
<p class="description"><%= para %></p>
|
203
|
-
<% end %>
|
204
|
-
<% end %>
|
205
|
-
|
206
|
-
<% unless comm.remarks.empty? %>
|
207
|
-
<h3>Remarks</h3>
|
208
|
-
<% comm.remarks.each do |rem| %>
|
209
|
-
<p class="remark"><%= rem %></p>
|
210
|
-
<% end %>
|
211
|
-
<% end %>
|
212
|
-
|
213
|
-
<% unless comm.deprecated.nil? %>
|
214
|
-
<h3>Deprecated</h3>
|
215
|
-
<p class="deprecated"><%= comm.deprecated %></p>
|
216
|
-
<% end %>
|
217
|
-
|
218
|
-
<% unless comm.nessus.nil? %>
|
219
|
-
<h3>Nessus Version</h3>
|
220
|
-
<p class="nessus"><%= comm.nessus %></p>
|
221
|
-
<% end %>
|
222
|
-
|
223
|
-
<% unless comm.categories.empty? %>
|
224
|
-
<h3>Categories</h3>
|
225
|
-
<ul>
|
226
|
-
<% comm.categories.sort.each do |cat| %>
|
227
|
-
<li><%= cat %></li>
|
228
|
-
<% end %>
|
229
|
-
</ul>
|
230
|
-
<% end %>
|
231
|
-
|
232
|
-
<% unless comm.anonparams.empty? %>
|
233
|
-
<h3>Anonymous Parameters</h3>
|
234
|
-
<dl>
|
235
|
-
<% comm.anonparams.sort.each do |name, block| %>
|
236
|
-
<dt><%= name %></dt>
|
237
|
-
<dd><%= block %></dd>
|
238
|
-
<% end %>
|
239
|
-
</dl>
|
240
|
-
<% end %>
|
241
|
-
<% end %>
|
242
|
-
|
243
|
-
<% unless @functions[name].nil? || @functions[name].empty? %>
|
244
|
-
<h3>Named Parameters</h3>
|
245
|
-
<dl>
|
246
|
-
<% @functions[name].sort.each do |name| %>
|
247
|
-
<dt><%= name %></dt>
|
248
|
-
<% unless comm.nil? || !comm.params.has_key?(name) %>
|
249
|
-
<dd><%= comm.params[name] %></dd>
|
250
|
-
<% end %>
|
251
|
-
<% end %>
|
252
|
-
</dl>
|
253
|
-
<% end %>
|
254
|
-
|
255
|
-
<% unless comm.nil? || comm.return.nil? %>
|
256
|
-
<h3>Return Value</h3>
|
257
|
-
<p class="return"><%= comm.return %></p>
|
258
|
-
<% end %>
|
259
|
-
|
260
|
-
<a href="#top">top</a>
|
261
|
-
<hr>
|
262
|
-
<% end %>
|
263
|
-
<% end %>
|
264
|
-
<% end %>
|
265
|
-
</div>
|
266
|
-
</body>
|
267
|
-
</html>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<!DOCTYPE HTML>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>nasldoc</title>
|
5
|
-
<!--<link rel="stylesheet" type="text/css" href="stylesheet.css">-->
|
6
|
-
<script src="jquery.js"></script>
|
7
|
-
<script src="bootstrap.js"></script>
|
8
|
-
<link rel="stylesheet" type="text/css" href="bootstrap.css">
|
9
|
-
</head>
|
10
|
-
<frameset cols="20%,80%">
|
11
|
-
<frame name="sidebar" src="sidebar.html">
|
12
|
-
<frameset rows="100%">
|
13
|
-
<frame name="content" src="overview.html">
|
14
|
-
</frameset>
|
15
|
-
</frameset>
|
16
|
-
</html>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>nasldoc</title>
|
4
|
-
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
5
|
-
</head>
|
6
|
-
<body>
|
7
|
-
<div id="content">
|
8
|
-
<table class="nopad">
|
9
|
-
<tr class="TableHeadingColor">
|
10
|
-
<td>
|
11
|
-
<a name="top"></a>
|
12
|
-
<h1>File Summary</h1>
|
13
|
-
</td>
|
14
|
-
</tr>
|
15
|
-
<% @file_list.sort.each do |file| %>
|
16
|
-
<% link = url(file) %>
|
17
|
-
<tr>
|
18
|
-
<td>
|
19
|
-
<a href="<%= link %>" target="content"><%= link %></a>
|
20
|
-
</td>
|
21
|
-
</tr>
|
22
|
-
<% end %>
|
23
|
-
</table>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>nasldoc</title>
|
4
|
-
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
5
|
-
</head>
|
6
|
-
<body>
|
7
|
-
<img src="nessus.jpg" />
|
8
|
-
<ul>
|
9
|
-
<li><a href="overview.html" target="content">Overview</a></li>
|
10
|
-
</ul>
|
11
|
-
<ul>
|
12
|
-
<% @file_list.sort.each_with_index do |file, i| %>
|
13
|
-
<% row = i.even? ? 'even' : 'odd' %>
|
14
|
-
<% link = url(file) %>
|
15
|
-
<li class="<%= row %>">
|
16
|
-
<a href="<%= link %>" target="content"><%= link %></a>
|
17
|
-
</li>
|
18
|
-
<% end %>
|
19
|
-
</ul>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<!DOCTYPE HTML>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>nasldoc</title>
|
5
|
-
<!--<link rel="stylesheet" type="text/css" href="stylesheet.css">-->
|
6
|
-
<script src="jquery.js"></script>
|
7
|
-
<script src="bootstrap.js"></script>
|
8
|
-
<link rel="stylesheet" type="text/css" href="bootstrap.css">
|
9
|
-
</head>
|
10
|
-
<frameset cols="20%,80%">
|
11
|
-
<frame name="sidebar" src="sidebar.html">
|
12
|
-
<frameset rows="100%">
|
13
|
-
<frame name="content" src="overview.html">
|
14
|
-
</frameset>
|
15
|
-
</frameset>
|
16
|
-
</html>
|