jaxrsdoc 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/annotations.rb +11 -3
- data/lib/jaxrsdoc_version.rb +1 -1
- data/lib/parse.rb +3 -2
- data/lib/templates.rb +33 -13
- data/site/jaxrsdoc.css +43 -8
- metadata +2 -2
data/lib/annotations.rb
CHANGED
@@ -44,6 +44,7 @@ module JaxrsDoc
|
|
44
44
|
class AnnotationsGroup
|
45
45
|
|
46
46
|
attr_reader :annotations
|
47
|
+
attr_accessor :javadoc
|
47
48
|
|
48
49
|
def initialize(annotations = [])
|
49
50
|
@annotations = Array.new(annotations)
|
@@ -74,14 +75,19 @@ module JaxrsDoc
|
|
74
75
|
|
75
76
|
class Annotation
|
76
77
|
|
77
|
-
attr_reader :name, :values
|
78
|
+
attr_reader :name, :values
|
78
79
|
|
79
80
|
def initialize(annotation_text)
|
81
|
+
@values = []
|
80
82
|
@text = annotation_text.strip
|
81
83
|
@name = @text.delete("@").split("(")[0]
|
82
84
|
parse_values
|
83
85
|
end
|
84
86
|
|
87
|
+
def value
|
88
|
+
@values[0]
|
89
|
+
end
|
90
|
+
|
85
91
|
def to_s
|
86
92
|
@text
|
87
93
|
end
|
@@ -89,14 +95,16 @@ module JaxrsDoc
|
|
89
95
|
private
|
90
96
|
|
91
97
|
def parse_values
|
92
|
-
@values = []
|
93
98
|
if(matches = /\((.*)\)/.match(@text))
|
94
99
|
tokens = matches[1].split(",")
|
95
100
|
tokens.each { |v|
|
96
101
|
@values << v.gsub(/\"|'/, "").strip
|
97
102
|
}
|
98
|
-
@value = tokens.first.gsub(/\"|'/, "").strip
|
99
103
|
end
|
104
|
+
|
105
|
+
@values.each { |v|
|
106
|
+
v.prepend("/") unless v.start_with?("/")
|
107
|
+
} if @name == 'Path'
|
100
108
|
end
|
101
109
|
|
102
110
|
end
|
data/lib/jaxrsdoc_version.rb
CHANGED
data/lib/parse.rb
CHANGED
@@ -59,8 +59,9 @@ module JaxrsDoc
|
|
59
59
|
descriptions.update(ParamDescriptionScanner.scan_params_descriptions(@java_file.head.content))
|
60
60
|
type_description = remove_params_description(@java_file.head.javadoc)
|
61
61
|
@java_file.method_blocks.each { |section|
|
62
|
-
group = AnnotationScanner.scan_annotations(section)
|
63
|
-
|
62
|
+
group = AnnotationScanner.scan_annotations(section.content)
|
63
|
+
group.javadoc = section.javadoc
|
64
|
+
descriptions.update(ParamDescriptionScanner.scan_params_descriptions(section.content))
|
64
65
|
unless group.empty?
|
65
66
|
verbs_annotations[:gets] << group if(group.get)
|
66
67
|
verbs_annotations[:posts] << group if(group.post)
|
data/lib/templates.rb
CHANGED
@@ -62,22 +62,27 @@ module JaxrsDoc
|
|
62
62
|
|
63
63
|
<div class="page-header">
|
64
64
|
<h1><% if resource.path %><%= resource.path.value %><% end %><pre class="pull-right"><%= resource.name %></pre></h1>
|
65
|
+
<% if resource.description %>
|
66
|
+
<div>
|
67
|
+
<pre class="javadoc"><%= resource.description %></pre>
|
68
|
+
</div>
|
69
|
+
<% end %>
|
65
70
|
</div>
|
66
|
-
|
67
|
-
<% if resource.description %>
|
68
|
-
<div>
|
69
|
-
<pre><%= resource.description %></pre>
|
70
|
-
</div>
|
71
|
-
<% end %>
|
72
71
|
|
73
72
|
<% resource.gets.each do |annot_group| %>
|
74
73
|
<div class="row">
|
75
|
-
<div class="get span12">
|
74
|
+
<div class="get verb span12">
|
76
75
|
<button class="btn btn-success pull-left disabled" href="#"><%= annot_group.get.name %></button>
|
77
76
|
<h3 class="pagination-centered"><% if annot_group.path %> <%= annot_group.path.value %> <% end %></h3>
|
78
77
|
</div>
|
78
|
+
<% if annot_group.javadoc %>
|
79
|
+
<div class="span12">
|
80
|
+
<pre class="get verb-javadoc"><%= annot_group.javadoc %></pre>
|
81
|
+
</div>
|
82
|
+
<% end %>
|
79
83
|
</div>
|
80
|
-
|
84
|
+
|
85
|
+
|
81
86
|
<% unless annot_group.queryparams.empty? %>
|
82
87
|
<div class="row">
|
83
88
|
<div class="span12">
|
@@ -104,10 +109,15 @@ module JaxrsDoc
|
|
104
109
|
|
105
110
|
<% resource.posts.each do |annot_group| %>
|
106
111
|
<div class="row">
|
107
|
-
<div class="post span12">
|
112
|
+
<div class="post verb span12">
|
108
113
|
<button class="btn btn-info pull-left disabled" href="#"><%= annot_group.post.name %></button>
|
109
114
|
<h3 class="pagination-centered"><% if annot_group.path %> <%= annot_group.path.value %> <% end %></h3>
|
110
|
-
</div>
|
115
|
+
</div>
|
116
|
+
<% if annot_group.javadoc %>
|
117
|
+
<div class="span12">
|
118
|
+
<pre class="post verb-javadoc"><%= annot_group.javadoc %></pre>
|
119
|
+
</div>
|
120
|
+
<% end %>
|
111
121
|
</div>
|
112
122
|
|
113
123
|
<% unless annot_group.params.empty? %>
|
@@ -136,10 +146,15 @@ module JaxrsDoc
|
|
136
146
|
|
137
147
|
<% resource.puts.each do |annot_group| %>
|
138
148
|
<div class="row">
|
139
|
-
<div class="put span12">
|
149
|
+
<div class="put verb span12">
|
140
150
|
<button class="btn btn-warning pull-left disabled" href="#"><%= annot_group.put.name %></button>
|
141
151
|
<h3 class="pagination-centered"><% if annot_group.path %> <%= annot_group.path.value %> <% end %></h3>
|
142
|
-
</div>
|
152
|
+
</div>
|
153
|
+
<% if annot_group.javadoc %>
|
154
|
+
<div class="span12">
|
155
|
+
<pre class="put verb-javadoc"><%= annot_group.javadoc %></pre>
|
156
|
+
</div>
|
157
|
+
<% end %>
|
143
158
|
</div>
|
144
159
|
|
145
160
|
<% unless annot_group.params.empty? %>
|
@@ -168,10 +183,15 @@ module JaxrsDoc
|
|
168
183
|
|
169
184
|
<% resource.deletes.each do |annot_group| %>
|
170
185
|
<div class="row">
|
171
|
-
<div class="
|
186
|
+
<div class="delete verb span12">
|
172
187
|
<button class="btn btn-danger pull-left disabled" href="#"><%= annot_group.delete.name %></button>
|
173
188
|
<h3 class="pagination-centered"><% if annot_group.path %> <%= annot_group.path.value %> <% end %></h3>
|
174
189
|
</div>
|
190
|
+
<% if annot_group.javadoc %>
|
191
|
+
<div class="span12">
|
192
|
+
<pre class="delete verb-javadoc"><%= annot_group.javadoc %></pre>
|
193
|
+
</div>
|
194
|
+
<% end %>
|
175
195
|
</div>
|
176
196
|
|
177
197
|
<% unless annot_group.params.empty? %>
|
data/site/jaxrsdoc.css
CHANGED
@@ -1,19 +1,54 @@
|
|
1
|
-
|
1
|
+
h1 {
|
2
|
+
font-family: Lucida Grande !important;
|
3
|
+
}
|
4
|
+
|
5
|
+
pre.javadoc {
|
6
|
+
margin-top: 20px;
|
7
|
+
color: #0088CC;
|
8
|
+
background-color: white;
|
9
|
+
font-size: 1.2em;
|
10
|
+
box-shadow: 2px 2px 3px #000;
|
11
|
+
-moz-box-shadow: 2px 2px 3px #000;
|
12
|
+
-webkit-box-shadow: 2px 2px 3px #000;
|
13
|
+
}
|
14
|
+
|
15
|
+
pre.verb-javadoc {
|
16
|
+
color: #0088CC;
|
17
|
+
background-color: white;
|
18
|
+
font-size: 1.0em;
|
19
|
+
box-shadow: 2px 2px 3px #000;
|
20
|
+
-moz-box-shadow: 2px 2px 3px #000;
|
21
|
+
-webkit-box-shadow: 2px 2px 3px #000;
|
22
|
+
}
|
23
|
+
|
24
|
+
table {
|
25
|
+
font-family: Lucida Grande;
|
26
|
+
font-size: 1.3em;
|
27
|
+
}
|
28
|
+
|
29
|
+
.verb {
|
2
30
|
margin-bottom: 0.5em;
|
3
|
-
|
31
|
+
margin-top: 0.6em;
|
32
|
+
box-shadow: 2px 2px 3px #000;
|
33
|
+
-moz-box-shadow: 2px 2px 3px #000;
|
34
|
+
-webkit-box-shadow: 2px 2px 3px #000;
|
35
|
+
border-radius: 4px 4px 4px 4px;
|
36
|
+
-moz-border-radius: 4px 4px 4px 4px;
|
37
|
+
-webkit-border-radius: 4px 4px 4px 4px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.get {
|
41
|
+
background-color: #D6EAD6 !important;
|
4
42
|
}
|
5
43
|
|
6
44
|
.post {
|
7
|
-
|
8
|
-
background-color: #EBF7FA;
|
45
|
+
background-color: #EBF7FA !important;
|
9
46
|
}
|
10
47
|
|
11
48
|
.put {
|
12
|
-
|
13
|
-
background-color: #FEEACD;
|
49
|
+
background-color: #FEEACD !important;
|
14
50
|
}
|
15
51
|
|
16
52
|
.delete {
|
17
|
-
|
18
|
-
background-color: #F0C8C7;
|
53
|
+
background-color: #F0C8C7 !important;
|
19
54
|
}
|
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.8
|
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-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: javaparse
|