nasldoc 0.0.8 → 0.0.9
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.
- data/LICENSE +25 -0
- data/NEWS.markdown +3 -0
- data/README.markdown +22 -38
- data/TODO.markdown +2 -1
- data/lib/nasldoc/cli/application.rb +3 -9
- data/lib/nasldoc.rb +4 -3
- data/nasldoc.gemspec +1 -1
- metadata +29 -36
data/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Copyright (c) 2011-2012 Jacob Hammack.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of the Jacob Hammack nor the names of its contributors
|
|
13
|
+
may be used to endorse or promote products derived from this software
|
|
14
|
+
without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
18
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL JACOB HAMMACK BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
20
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
21
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
|
22
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
24
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
25
|
+
OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/NEWS.markdown
CHANGED
data/README.markdown
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Installation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Installation is really easy, all you need to do is gem install!
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
% gem install nasldoc
|
|
6
6
|
|
|
7
|
-
#Development
|
|
8
|
-
|
|
9
|
-
Before writing nasldoc from scratch I tried to use several different open source solutions.
|
|
10
|
-
|
|
11
|
-
- jsdoc - This tool was promising but the author hardcoded /** */ as the comment delimiter which causes issues with Nasl since we cannot add a new comment style.
|
|
12
|
-
- javadoc - Parsed out the java language which made it impossible to do Nasl with it
|
|
13
|
-
- phpDocumentor - Worked well on parsing .inc files, but required /** */ comment styles
|
|
14
|
-
- Doxygen - Everything about Doxygen is hardcoded into the source, I wasn't able to change anything to get it to work with Nasl.
|
|
15
7
|
|
|
16
8
|
#Usage
|
|
17
9
|
|
|
@@ -27,40 +19,32 @@ Nasldoc comments are inclosed in ## blocks and use special tags to mark items, c
|
|
|
27
19
|
|
|
28
20
|
Nasldoc supports several markup tags this tags are:
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
- @param - used to label named arguments to a function
|
|
23
|
+
- @anonparam - used to label anonymous arguments to a function
|
|
24
|
+
- @return - what the function returns
|
|
25
|
+
- @deprecated
|
|
26
|
+
- @nessus
|
|
27
|
+
- @category
|
|
28
|
+
- @remark
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
#Function Description Block
|
|
35
31
|
|
|
36
32
|
The function description block is free form text from the first ## to the first @tag in the nasldoc body, the lines are split on the # and rejoined with spaces.
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
#Example
|
|
39
35
|
|
|
40
36
|
<pre>
|
|
41
37
|
##
|
|
42
|
-
#
|
|
38
|
+
# An example addition function in NASL
|
|
43
39
|
#
|
|
44
|
-
# @param
|
|
40
|
+
# @param arg1 first number to add
|
|
41
|
+
# @param arg2 second number to add
|
|
45
42
|
#
|
|
46
|
-
# @return
|
|
43
|
+
# @return The sum of arg1 and arg2
|
|
47
44
|
##
|
|
48
|
-
function
|
|
45
|
+
function add(arg1, arg2)
|
|
49
46
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
version_pkt =
|
|
53
|
-
maxdb_command_pkt() +
|
|
54
|
-
"dbm_version";
|
|
55
|
-
|
|
56
|
-
version_pkt = insstr(version_pkt, mkdword(strlen(version_pkt)), 0, 3);
|
|
57
|
-
version_pkt = insstr(version_pkt, mkdword(strlen(version_pkt)), 20, 23);
|
|
58
|
-
|
|
59
|
-
send(socket:socket, data:version_pkt);
|
|
60
|
-
data = maxdb_read_pkt(socket:socket);
|
|
61
|
-
version = maxdb_parse_version_info(data:data);
|
|
62
|
-
|
|
63
|
-
return version;
|
|
47
|
+
return (arg1 + arg2);
|
|
64
48
|
}
|
|
65
49
|
</pre>
|
|
66
50
|
|
|
@@ -70,8 +54,8 @@ Nasldoc uses the ERB templating engine to make generating the output html dead s
|
|
|
70
54
|
|
|
71
55
|
##Example
|
|
72
56
|
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
|
|
58
|
+
`<html>
|
|
75
59
|
<head>
|
|
76
60
|
<title>nasldoc</title>
|
|
77
61
|
<link rel = 'stylesheet' type= 'text/css' href='stylesheet.css'>
|
|
@@ -90,5 +74,5 @@ Nasldoc uses the ERB templating engine to make generating the output html dead s
|
|
|
90
74
|
<br><br><br>
|
|
91
75
|
<ul><a href='overview.html' target='content'>Home</a></ul>
|
|
92
76
|
</body>
|
|
93
|
-
</html
|
|
94
|
-
|
|
77
|
+
</html>`
|
|
78
|
+
|
data/TODO.markdown
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
# Todo
|
|
2
|
+
- create a github page for the project
|
|
@@ -54,12 +54,6 @@ module NaslDoc
|
|
|
54
54
|
puts "[*] Processing File: #{file}"
|
|
55
55
|
@current_file = File.basename(file, ".inc")
|
|
56
56
|
contents = File.open(file, 'rb') { |f| f.read } unless file == nil
|
|
57
|
-
|
|
58
|
-
##
|
|
59
|
-
add_nasldoc_stubs contents
|
|
60
|
-
exit
|
|
61
|
-
##
|
|
62
|
-
|
|
63
57
|
|
|
64
58
|
contents = process_file_overview contents
|
|
65
59
|
process_file_includes contents
|
|
@@ -132,11 +126,11 @@ module NaslDoc
|
|
|
132
126
|
nasldoc << "#\n"
|
|
133
127
|
nasldoc << "##\n"
|
|
134
128
|
nasldoc << "#{function} #{name}#{openpar}#{args}#{closepar}"
|
|
135
|
-
|
|
129
|
+
|
|
136
130
|
new_file = new_file.gsub(line, nasldoc)
|
|
137
|
-
|
|
131
|
+
|
|
138
132
|
end
|
|
139
|
-
|
|
133
|
+
|
|
140
134
|
puts new_file
|
|
141
135
|
end
|
|
142
136
|
|
data/lib/nasldoc.rb
CHANGED
data/nasldoc.gemspec
CHANGED
|
@@ -7,7 +7,7 @@ require 'nasldoc'
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "#{NaslDoc::APP_NAME}"
|
|
9
9
|
s.version = NaslDoc::VERSION
|
|
10
|
-
s.homepage = "
|
|
10
|
+
s.homepage = "http://hammackj.com/projects/nasldoc"
|
|
11
11
|
s.summary = "#{NaslDoc::APP_NAME}"
|
|
12
12
|
s.description = "#{NaslDoc::APP_NAME} is a NASL documentation generator"
|
|
13
13
|
s.license = "BSD"
|
metadata
CHANGED
|
@@ -1,72 +1,65 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nasldoc
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.9
|
|
4
5
|
prerelease:
|
|
5
|
-
version: 0.0.8
|
|
6
6
|
platform: ruby
|
|
7
|
-
authors:
|
|
7
|
+
authors:
|
|
8
8
|
- Jacob Hammack
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
|
|
13
|
-
date: 2011-07-14 00:00:00 -05:00
|
|
14
|
-
default_executable:
|
|
12
|
+
date: 2012-08-24 00:00:00.000000000 Z
|
|
15
13
|
dependencies: []
|
|
16
|
-
|
|
17
14
|
description: nasldoc is a NASL documentation generator
|
|
18
15
|
email: jhammack@tenable.com
|
|
19
|
-
executables:
|
|
16
|
+
executables:
|
|
20
17
|
- nasldoc
|
|
21
18
|
extensions: []
|
|
22
|
-
|
|
23
|
-
extra_rdoc_files:
|
|
19
|
+
extra_rdoc_files:
|
|
24
20
|
- README.markdown
|
|
25
21
|
- NEWS.markdown
|
|
26
22
|
- TODO.markdown
|
|
27
|
-
files:
|
|
28
|
-
- NEWS.markdown
|
|
29
|
-
- Rakefile
|
|
23
|
+
files:
|
|
30
24
|
- README.markdown
|
|
25
|
+
- LICENSE
|
|
26
|
+
- NEWS.markdown
|
|
31
27
|
- TODO.markdown
|
|
32
|
-
-
|
|
33
|
-
- lib/nasldoc/assets/stylesheet.css
|
|
34
|
-
- lib/nasldoc/cli/application.rb
|
|
35
|
-
- lib/nasldoc/cli.rb
|
|
28
|
+
- Rakefile
|
|
36
29
|
- lib/nasldoc/templates/file.erb
|
|
37
30
|
- lib/nasldoc/templates/index.erb
|
|
38
|
-
- lib/nasldoc/templates/overview.erb
|
|
39
31
|
- lib/nasldoc/templates/sidebar.erb
|
|
32
|
+
- lib/nasldoc/templates/overview.erb
|
|
33
|
+
- lib/nasldoc/assets/stylesheet.css
|
|
34
|
+
- lib/nasldoc/assets/nessus.jpg
|
|
35
|
+
- lib/nasldoc/cli.rb
|
|
36
|
+
- lib/nasldoc/cli/application.rb
|
|
40
37
|
- lib/nasldoc.rb
|
|
41
38
|
- nasldoc.gemspec
|
|
42
39
|
- bin/nasldoc
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
licenses:
|
|
40
|
+
homepage: http://hammackj.com/projects/nasldoc
|
|
41
|
+
licenses:
|
|
46
42
|
- BSD
|
|
47
43
|
post_install_message:
|
|
48
44
|
rdoc_options: []
|
|
49
|
-
|
|
50
|
-
require_paths:
|
|
45
|
+
require_paths:
|
|
51
46
|
- lib
|
|
52
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
48
|
none: false
|
|
54
|
-
requirements:
|
|
55
|
-
- -
|
|
56
|
-
- !ruby/object:Gem::Version
|
|
57
|
-
version:
|
|
58
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ! '>='
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
54
|
none: false
|
|
60
|
-
requirements:
|
|
61
|
-
- -
|
|
62
|
-
- !ruby/object:Gem::Version
|
|
55
|
+
requirements:
|
|
56
|
+
- - ! '>='
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
63
58
|
version: 1.3.6
|
|
64
59
|
requirements: []
|
|
65
|
-
|
|
66
60
|
rubyforge_project: nasldoc
|
|
67
|
-
rubygems_version: 1.
|
|
61
|
+
rubygems_version: 1.8.24
|
|
68
62
|
signing_key:
|
|
69
63
|
specification_version: 3
|
|
70
64
|
summary: nasldoc
|
|
71
65
|
test_files: []
|
|
72
|
-
|