jaxrsdoc 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jaxrsdoc_version.rb +1 -1
- data/lib/parse.rb +19 -24
- metadata +2 -2
data/lib/jaxrsdoc_version.rb
CHANGED
data/lib/parse.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require File.expand_path("../annotations.rb", __FILE__)
|
2
|
+
require 'javaparse'
|
3
|
+
|
4
|
+
include JavaParse
|
2
5
|
|
3
6
|
module JaxrsDoc
|
4
7
|
|
@@ -42,22 +45,20 @@ module JaxrsDoc
|
|
42
45
|
end
|
43
46
|
|
44
47
|
module ResourceParser
|
45
|
-
include AnnotationScanner
|
46
48
|
|
47
49
|
def self.parse(file)
|
50
|
+
@java_file = JavaUnit.new(file.path)
|
48
51
|
@filename = File.basename(file.path)
|
49
|
-
parse_content
|
52
|
+
parse_content
|
50
53
|
end
|
51
54
|
|
52
|
-
def self.parse_content
|
55
|
+
def self.parse_content
|
53
56
|
verbs_annotations = {:gets => [], :posts => [], :puts => [], :deletes => []}
|
54
57
|
descriptions = {}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
type_description = parse_resource_description(resource_head_section)
|
60
|
-
java_sections.each { |section|
|
58
|
+
type_annotations = AnnotationScanner.scan_annotations(@java_file.head.content)
|
59
|
+
descriptions.update(ParamDescriptionScanner.scan_params_descriptions(@java_file.head.content))
|
60
|
+
type_description = remove_params_description(@java_file.head.javadoc)
|
61
|
+
@java_file.method_blocks.each { |section|
|
61
62
|
group = AnnotationScanner.scan_annotations(section)
|
62
63
|
descriptions.update(ParamDescriptionScanner.scan_params_descriptions(section))
|
63
64
|
unless group.empty?
|
@@ -68,23 +69,17 @@ module JaxrsDoc
|
|
68
69
|
end
|
69
70
|
}
|
70
71
|
JaxrsDoc::Resource.new(@filename, type_annotations, verbs_annotations, type_description, descriptions)
|
71
|
-
end
|
72
|
+
end
|
72
73
|
|
73
|
-
private
|
74
|
+
private
|
74
75
|
|
75
|
-
def self.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
description = ""
|
83
|
-
full_text.each_line { |line|
|
84
|
-
description << line unless line.include?("@param")
|
85
|
-
}
|
86
|
-
description
|
87
|
-
end
|
76
|
+
def self.remove_params_description(text)
|
77
|
+
return nil unless text
|
78
|
+
description = ""
|
79
|
+
text.each_line { |line|
|
80
|
+
description << line unless line.include?("@param")
|
81
|
+
}
|
82
|
+
description
|
88
83
|
end
|
89
84
|
|
90
85
|
end
|
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.5
|
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-22 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|