jaxrsdoc 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/jaxrsdoc +34 -9
- data/lib/jaxrsdoc_version.rb +1 -1
- data/lib/templates.rb +1 -1
- metadata +2 -2
data/bin/jaxrsdoc
CHANGED
@@ -1,35 +1,60 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require File.expand_path("../../lib/parse.rb", __FILE__)
|
3
3
|
require File.expand_path("../../lib/site.rb", __FILE__)
|
4
|
+
require File.expand_path("../../lib/jaxrsdoc_version.rb", __FILE__)
|
4
5
|
require 'optparse'
|
5
6
|
require "rexml/document"
|
6
7
|
|
7
8
|
options = {}
|
9
|
+
|
10
|
+
usage_examples = <<EX
|
11
|
+
# Generate site from the project sources
|
12
|
+
$ jaxrsdoc /Users/me/projects/mysources
|
13
|
+
|
14
|
+
# Generate site from the project sources specifying a name and version
|
15
|
+
$ jaxrsdoc -a MyPetProject -r 1.0.2 /Users/me/projects/mysources
|
16
|
+
|
17
|
+
# Generate site from a Maven project
|
18
|
+
$ jaxrsdoc -m /Users/me/projects/mysources
|
19
|
+
|
20
|
+
# Generate site for the project with a specific pattern matching of the REST resources
|
21
|
+
$ jaxrsdoc -m -p "*ResourceEntity.java" /Users/me/projects/mysources
|
22
|
+
EX
|
23
|
+
|
8
24
|
optparse = OptionParser.new do |opts|
|
9
|
-
opts.banner = "USAGE\n jaxrsdoc [options]
|
25
|
+
opts.banner = "USAGE\n jaxrsdoc [options] project_sources_location"
|
10
26
|
opts.separator "\nOPTIONS\n"
|
11
27
|
|
12
28
|
options[:pattern] = "*Resource.java"
|
13
|
-
opts.on( '-p', '--pattern PATTERN', '
|
29
|
+
opts.on( '-p', '--pattern PATTERN', 'Pattern of the Jaxrs annotated files java resources. Default is: "*Resource.java"' ) do |pattern|
|
14
30
|
options[:pattern] = pattern
|
15
31
|
end
|
16
32
|
|
17
|
-
opts.on( '-m', '--maven', '
|
33
|
+
opts.on( '-m', '--maven', 'Specify a maven project. Project name & version will be derived from the pom.xml found at the directory level' ) do |maven|
|
18
34
|
options[:maven] = true
|
19
35
|
end
|
20
36
|
|
21
|
-
opts.on(
|
22
|
-
options[:
|
37
|
+
opts.on('-a', '--project-name NAME', 'Custom name of the project to be included on the website banner' ) do |project_name|
|
38
|
+
options[:project_name] = project_name
|
23
39
|
end
|
24
40
|
|
25
|
-
opts.on(
|
26
|
-
options[:
|
41
|
+
opts.on('-r', '--project-version VERSION', 'Custom version of the project to be included on the website banner' ) do |project_version|
|
42
|
+
options[:project_version] = project_version
|
43
|
+
end
|
44
|
+
|
45
|
+
opts.on('-v', '--version', 'Current version of Jaxrsdoc executable' ) do
|
46
|
+
puts "Jaxrsdoc version: #{JaxrsDoc::VERSION}"
|
47
|
+
exit
|
27
48
|
end
|
28
49
|
|
29
50
|
opts.on( '-h', '--help', 'Display this screen' ) do
|
30
51
|
puts opts
|
52
|
+
puts usage_examples
|
31
53
|
exit
|
32
54
|
end
|
55
|
+
|
56
|
+
opts.separator "\nEXAMPLES"
|
57
|
+
|
33
58
|
end
|
34
59
|
|
35
60
|
begin
|
@@ -51,8 +76,8 @@ processed_resources = matched_files.map {|file|
|
|
51
76
|
}.select {|resource| resource.valid? and not resource.nil? }
|
52
77
|
puts "Processed #{processed_resources.size} files with a @Path type annotation"
|
53
78
|
|
54
|
-
project_version = options[:
|
55
|
-
project_name = options[:
|
79
|
+
project_version = options[:project_version]
|
80
|
+
project_name = options[:project_name]
|
56
81
|
|
57
82
|
if(options[:maven]) then
|
58
83
|
puts "Looking for a pom.xml file at #{resources_location}"
|
data/lib/jaxrsdoc_version.rb
CHANGED
data/lib/templates.rb
CHANGED
@@ -31,7 +31,7 @@ module JaxrsDoc
|
|
31
31
|
<% end %>
|
32
32
|
</div>
|
33
33
|
<% end%>
|
34
|
-
<footer class="modal-footer"><span>Powered by <a href="
|
34
|
+
<footer class="modal-footer"><span>Powered by <a href="http://simcap.github.com/jaxrsdoc">Jaxrsdoc</a></span></footer>
|
35
35
|
</div>
|
36
36
|
<body>
|
37
37
|
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jaxrsdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|