yard-rest-plugin 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/README.markdown +79 -4
  2. data/Rakefile +3 -2
  3. data/VERSION +1 -1
  4. data/example/SampleController.rb +54 -5
  5. data/lib/yard-rest-plugin.rb +5 -1
  6. data/templates/rest/tags/setup.rb +6 -1
  7. metadata +18 -41
  8. data/example/README.markdown +0 -11
  9. data/pkg/yard-rest-plugin-0.1.5.gem +0 -0
  10. data/pkg/yard-rest-plugin-0.2.0.gem +0 -0
  11. data/pkg/yard-rest-plugin-0.2.1.gem +0 -0
  12. data/templates/rest/.DS_Store +0 -0
  13. data/templates/rest/class/html/header.erb +0 -24
  14. data/templates/rest/class/html/method_details_list.erb +0 -6
  15. data/templates/rest/disqus/html/disqus.erb +0 -24
  16. data/templates/rest/docstring/html/text.erb +0 -1
  17. data/templates/rest/fulldoc/.DS_Store +0 -0
  18. data/templates/rest/fulldoc/html/.DS_Store +0 -0
  19. data/templates/rest/fulldoc/html/css/common.css +0 -1
  20. data/templates/rest/fulldoc/html/css/full_list.css +0 -78
  21. data/templates/rest/fulldoc/html/css/style.css +0 -235
  22. data/templates/rest/fulldoc/html/full_list.erb +0 -29
  23. data/templates/rest/fulldoc/html/full_list_files.erb +0 -5
  24. data/templates/rest/fulldoc/html/full_list_resource.erb +0 -8
  25. data/templates/rest/fulldoc/html/full_list_topic.erb +0 -12
  26. data/templates/rest/fulldoc/html/js/app.js +0 -42
  27. data/templates/rest/fulldoc/html/js/full_list.js +0 -117
  28. data/templates/rest/fulldoc/html/js/jquery.js +0 -19
  29. data/templates/rest/layout/html/footer.erb +0 -3
  30. data/templates/rest/layout/html/headers.erb +0 -13
  31. data/templates/rest/layout/html/index.erb +0 -55
  32. data/templates/rest/layout/html/layout.erb +0 -22
  33. data/templates/rest/layout/html/search.erb +0 -5
  34. data/templates/rest/method_details/html/header.erb +0 -3
  35. data/templates/rest/method_details/html/method_signature.erb +0 -7
  36. data/templates/rest/tags/html/example_response.erb +0 -9
  37. data/templates/rest/tags/html/generic_tag.erb +0 -17
  38. data/templates/rest/tags/html/index.erb +0 -3
  39. data/yard-rest-plugin.gemspec +0 -85
Binary file
Binary file
@@ -1 +0,0 @@
1
- /* Override this file with custom rules */
@@ -1,78 +0,0 @@
1
- body {
2
- font-family:"Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
3
- font-size:13px;
4
- height:101%;
5
- overflow-x:hidden;
6
- margin:0;
7
- }
8
-
9
- h1 {
10
- font-size:1.4em;
11
- margin:0;
12
- padding:12px 10px 0;
13
- }
14
-
15
- .clear { clear:both; }
16
-
17
- #search {
18
- position:absolute;
19
- right:5px;
20
- top:9px;
21
- }
22
-
23
- #full_list {
24
- list-style:none;
25
- margin-left:0;
26
- padding:0;
27
- }
28
-
29
- #full_list ul { padding:0; }
30
-
31
- #full_list li {
32
- font-size:1.1em;
33
- list-style:none;
34
- margin:0;
35
- padding:5px 5px 5px 12px;
36
- }
37
-
38
- #noresults {
39
- display:none;
40
- padding:7px 12px;
41
- }
42
-
43
- li {
44
- color:#888;
45
- cursor:pointer;
46
- }
47
-
48
- li.r1 { background: #fafafa; }
49
- li.r2 { background: #f0f0f0; }
50
-
51
- li:hover { background:#ddd; }
52
-
53
- a:link,a:visited {
54
- text-decoration:none;
55
- color:#05a;
56
- }
57
-
58
- li.clicked {
59
- background:#05a;
60
- color:#ccc;
61
- }
62
-
63
- li.clicked a:link,li.clicked a:visited {
64
- color:#eee;
65
- }
66
-
67
- #search input {
68
- border:1px solid #bbb;
69
- -moz-border-radius:3px;
70
- -webkit-border-radius:3px;
71
- }
72
-
73
- #full_list.insearch li.found {
74
- display:list-item;
75
- padding-left:10px;
76
- }
77
-
78
- #full_list.insearch li { display:none; }
@@ -1,235 +0,0 @@
1
- body {
2
- padding: 0 20px;
3
- font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
4
- font-size: 13px;
5
- }
6
-
7
- h1 {
8
- font-size: 25px;
9
- margin: 1em 0 0.5em;
10
- padding-top: 4px;
11
- }
12
-
13
- h1.noborder {
14
- border-top: 0px;
15
- margin-top: 0;
16
- padding-top: 4px;
17
- }
18
-
19
- h1.title { margin-bottom: 10px; }
20
-
21
- h1.alphaindex {
22
- margin-top: 0;
23
- font-size: 22px;
24
- }
25
-
26
- h1 .minor_heading { color: #777777; }
27
-
28
- h2 {
29
- padding: 0;
30
- padding-bottom: 3px;
31
- border-bottom: 1px #aaa solid;
32
- font-size: 1.4em;
33
- margin: 1.8em 0 0.5em;
34
- }
35
-
36
- .inline { display: inline; }
37
- .inline p:first-child { display: inline; }
38
-
39
- h3.inherited {
40
- font-style: italic;
41
- font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
42
- font-weight: normal;
43
- padding: 0;
44
- margin: 0;
45
- margin-top: 12px;
46
- margin-bottom: 3px;
47
- font-size: 13px;
48
- }
49
- p.inherited {
50
- padding: 0;
51
- margin: 0;
52
- margin-left: 25px;
53
- }
54
-
55
- /* Content */
56
- #content a:link, #content a:visited {
57
- text-decoration: none;
58
- color: #05a;
59
- }
60
- #content a:hover {
61
- background: #ffffa5;
62
- }
63
-
64
- /* Index files listing */
65
- #files {
66
- padding-left: 15px;
67
- font-size: 1.1em;
68
- padding: 0;
69
- }
70
- #files li {
71
- list-style: none;
72
- display: inline;
73
- padding: 7px 12px;
74
- line-height: 35px;
75
- }
76
-
77
- .method_details {
78
- border-top: 1px dotted #aaa;
79
- margin-top: 15px;
80
- padding-top: 0;
81
- }
82
- .method_details.first { border: 0; }
83
-
84
- ul.signature {
85
- font-size: 1.1em;
86
- font-weight: normal;
87
- font-family: Monaco, Consolas, Courier, monospace;
88
- padding: 6px 10px;
89
- margin-top: 18px;
90
- background: #e5e8ff;
91
- border: 1px solid #d8d8e5;
92
- -moz-border-radius: 3px;
93
- -webkit-border-radius: 3px;
94
- list-style: none;
95
- }
96
-
97
- /* All tags */
98
- .tags { margin-bottom: 12px; }
99
- .tags h3 {
100
- font-size: 1em;
101
- margin-bottom: 0;
102
- }
103
- .tags ul {
104
- margin-top: 5px;
105
- padding-left: 30px;
106
- list-style: square;
107
- }
108
- .tags ul li {
109
- margin-bottom: 3px;
110
- }
111
- .tags ul .name {
112
- font-family: monospace;
113
- font-weight: bold;
114
- }
115
- .tags ul p.note { padding: 3px 6px; }
116
-
117
- /* Repsonse example tag */
118
- .tags .examples h3 { margin-bottom: 10px; }
119
- .tags .examples h4 {
120
- padding: 0;
121
- margin: 0;
122
- margin-left: 15px;
123
- font-weight: bold;
124
- font-size: 0.9em;
125
- }
126
- .tags .example {
127
- padding: 5px 12px;
128
- margin-top: 4px;
129
- border: 1px solid #eef;
130
- background: #f5f5ff;
131
- }
132
-
133
-
134
- /* Search menu */
135
- #search {
136
- position: absolute;
137
- right: 14px;
138
- top: 0px;
139
- }
140
- #search a:link, #search a:visited {
141
- display: block; float: left; margin-right: 4px;
142
- padding: 8px 10px; text-decoration: none; color: #05a; background: #eaeaff;
143
- border: 1px solid #d8d8e5;
144
- -moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
145
- -webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
146
- }
147
- #search a:hover {
148
- background: #eef;
149
- color: #06b;
150
- }
151
- #search a.active {
152
- background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
153
- -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
154
- -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
155
- }
156
- #search a.inactive {
157
- color: #999;
158
- }
159
-
160
- /* Search frame */
161
- #search_frame {
162
- background: #fff;
163
- display: none;
164
- position: absolute;
165
- top: 36px;
166
- right: 18px;
167
- width: 500px;
168
- height: 80%;
169
- overflow-y: scroll;
170
- border: 1px solid #999;
171
- border-collapse: collapse;
172
- -webkit-box-shadow: -2px 5px 25px #aaa;
173
- -moz-box-shadow: -2px 5px 25px #aaa;
174
- -moz-border-radius: 2px;
175
- -webkit-border-radius: 2px;
176
- }
177
-
178
- /* Footer */
179
- #footer {
180
- margin-top: 15px;
181
- border-top: 1px solid #ccc;
182
- text-align: center;
183
- padding: 7px 0;
184
- color: #999;
185
- }
186
-
187
- /* Alphabetal Index Listing */
188
- #listing ul.alpha { font-size: 1.1em; }
189
- #listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
190
- #listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
191
- #listing ul.alpha ul { margin: 0; padding-left: 15px; }
192
-
193
- li.r1 { background: #f0f0f0; }
194
- li.r2 { background: #fafafa; }
195
-
196
- /* Note tag */
197
- .note {
198
- color: #222;
199
- -moz-border-radius: 3px;
200
- -webkit-border-radius: 3px;
201
- background: #e3e4e3;
202
- border: 1px solid #d5d5d5;
203
- padding: 7px 10px;
204
- }
205
- .note.todo {
206
- background: #ffffc5;
207
- border-color: #ececaa;
208
- }
209
- .note.title {
210
- text-transform: lowercase;
211
- padding: 1px 5px;
212
- margin-left: 5px;
213
- font-size: 0.9em;
214
- font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
215
- }
216
- h1 .note.title {
217
- font-size: 0.5em;
218
- font-weight: normal;
219
- padding: 3px 5px;
220
- position: relative;
221
- top: -3px;
222
- text-transform: capitalize;
223
- }
224
-
225
- ul.box {
226
- font-size: 1em;
227
- height: 1em;
228
- }
229
-
230
- ul.box li {
231
- float: left;
232
- display: block;
233
- text-align: left;
234
- padding-right: 10px;
235
- }
@@ -1,29 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html>
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=<%= charset %>" />
6
- <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
- <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
10
- <base id="base_target" target="_parent" />
11
- </head>
12
- <body>
13
- <script type="text/javascript" charset="utf-8">
14
- if (window.top.frames.main) {
15
- document.getElementById('base_target').target = 'main';
16
- document.body.className = 'frames';
17
- }
18
- </script>
19
- <div id="content">
20
- <h1 id="full_list_header"><%= @list_title %></h1>
21
- <div id="search">Search: <input type="text" /></div>
22
-
23
- <ul id="full_list" class="<%= @list_type %>">
24
- <%= erb "full_list_#{@list_type}" %>
25
- </ul>
26
- </div>
27
- </body>
28
- </html>
29
-
@@ -1,5 +0,0 @@
1
- <% n = 1 %>
2
- <% @items.each do |item| %>
3
- <li class="r<%= n %>"><%= link_file item, File.basename(item).gsub(/\.[^.]+$/, '') %></li>
4
- <% n = n == 2 ? 1 : 2 %>
5
- <% end %>
@@ -1,8 +0,0 @@
1
- <li><a href="<%= url_for('_index.html') %>">Index</a></li>
2
- <% n = 1 %>
3
- <% @items.sort_by {|s| s.name.to_s }.each do |resource| %>
4
- <% unless resource.tags("url").first.nil? %>
5
- <li class="r<%= n %>"><%= linkify(resource, resource.tags("url").first.text) %></li>
6
- <% end %>
7
- <% n = n == 2 ? 1 : 2 %>
8
- <% end %>
@@ -1,12 +0,0 @@
1
- <li><a href="<%= url_for('_index.html') %>">Index</a></li>
2
- <% n = 1 %>
3
- <% @topics.sort_by {|s,o| s }.each do |topic,objects| %>
4
- <li class="r<%= n %>"><%= topic%></li>
5
- <% unless objects.empty? %>
6
- <% objects.each do |object| %>
7
- <li class="r<%= n %>"><%= linkify(object, object.tag("url").text) %></li>
8
- <% end%>
9
- <% end %>
10
- <% n = n == 2 ? 1 : 2 %>
11
- <% end %>
12
-
@@ -1,42 +0,0 @@
1
-
2
- function fixBoxInfoHeights() {
3
- $('dl.box dd.r1, dl.box dd.r2').each(function() {
4
- $(this).prev().height($(this).height());
5
- });
6
- }
7
- function searchFrameLinks() {
8
- $('#topic_list_link').click(function() {
9
- toggleSearchFrame(this, relpath + 'topic_list.html');
10
- });
11
-
12
- $('#resource_list_link').click(function() {
13
- toggleSearchFrame(this, relpath + 'resource_list.html');
14
- });
15
-
16
- $('#file_list_link').click(function() {
17
- toggleSearchFrame(this, relpath + 'file_list.html');
18
- });
19
- }
20
-
21
- function toggleSearchFrame(id, link) {
22
- var frame = $('#search_frame');
23
- $('#search a').removeClass('active').addClass('inactive');
24
- if (frame.attr('src') == link && frame.css('display') != "none") {
25
- frame.slideUp(100);
26
- $('#search a').removeClass('active inactive');
27
- }
28
- else {
29
- $(id).addClass('active').removeClass('inactive');
30
- frame.attr('src', link).slideDown(100);
31
- }
32
- }
33
-
34
- function linkSummaries() {
35
- $('.summary_signature').click(function() {
36
- document.location = $(this).find('a').attr('href');
37
- });
38
- }
39
-
40
- $(fixBoxInfoHeights);
41
- $(searchFrameLinks);
42
- $(linkSummaries);
@@ -1,117 +0,0 @@
1
- function fullListSearch() {
2
- $('#search input').keyup(function() {
3
- var value = this.value.toLowerCase();
4
- if (value == "") {
5
- $('#full_list').removeClass('insearch');
6
- $('#full_list li').each(function() {
7
- var link = $(this).children('a:last');
8
- link.text(link.text());
9
- });
10
- if (clicked) {
11
- clicked.parents('ul').each(function() {
12
- $(this).removeClass('collapsed').prev().removeClass('collapsed');
13
- });
14
- }
15
- highlight();
16
- }
17
- else {
18
- $('#full_list').addClass('insearch');
19
- $('#full_list li').each(function() {
20
- var link = $(this).children('a:last');
21
- var text = link.text();
22
- if (text.toLowerCase().indexOf(value) == -1) {
23
- $(this).removeClass('found');
24
- link.text(link.text());
25
- }
26
- else {
27
- $(this).css('padding-left', '10px').addClass('found');
28
- link.html(link.text().replace(new RegExp("(" +
29
- value.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
30
- '<strong>$1</strong>'));
31
- }
32
- });
33
- highlight(true);
34
- }
35
-
36
- if ($('#full_list li:visible').size() == 0) {
37
- $('#noresults').fadeIn();
38
- }
39
- else {
40
- $('#noresults').hide();
41
- }
42
- });
43
-
44
- $('#search input').focus();
45
- $('#full_list').after("<div id='noresults'>No results were found.</div>")
46
- }
47
-
48
- clicked = null;
49
- function linkList() {
50
- $('#full_list li, #full_list li a:last').click(function(evt) {
51
- if ($(this).hasClass('toggle')) return true;
52
- if (this.tagName.toLowerCase() == "li") {
53
- var toggle = $(this).children('a.toggle');
54
- if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
55
- toggle.click();
56
- return false;
57
- }
58
- }
59
- if (clicked) clicked.removeClass('clicked');
60
- var win = window.parent;
61
- if (window.top.frames.main) {
62
- win = window.top.frames.main;
63
- var title = $('html head title', win.document).text();
64
- $('html head title', window.parent.document).text(title);
65
- }
66
- if (this.tagName.toLowerCase() == "a") {
67
- clicked = $(this).parent('li').addClass('clicked');
68
- win.location = this.href;
69
- }
70
- else {
71
- clicked = $(this).addClass('clicked');
72
- win.location = $(this).find('a:last').attr('href');
73
- }
74
- return false;
75
- });
76
- }
77
-
78
- function collapse() {
79
- if (!$('#full_list').hasClass('class')) return;
80
- $('#full_list.class a.toggle').click(function() {
81
- $(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
82
- highlight();
83
- return false;
84
- });
85
- $('#full_list.class ul').each(function() {
86
- $(this).addClass('collapsed').prev().addClass('collapsed');
87
- });
88
- $('#full_list.class').children().removeClass('collapsed');
89
- highlight();
90
- }
91
-
92
- function highlight(no_padding) {
93
- var n = 1;
94
- $('#full_list li:visible').each(function() {
95
- var next = n == 1 ? 2 : 1;
96
- $(this).removeClass("r" + next).addClass("r" + n);
97
- if (!no_padding && $('#full_list').hasClass('class')) {
98
- $(this).css('padding-left', (10 + $(this).parents('ul').size() * 15) + 'px');
99
- }
100
- n = next;
101
- });
102
- }
103
-
104
- function escapeShortcut() {
105
- $(document).keydown(function(evt) {
106
- if (evt.which == 27) {
107
- $('#search_frame', window.top.document).slideUp(100);
108
- $('#search a', window.top.document).removeClass('active inactive')
109
- $(window.top).focus();
110
- }
111
- });
112
- }
113
-
114
- $(escapeShortcut);
115
- $(fullListSearch);
116
- $(linkList);
117
- $(collapse);