riddl 0.99.200 → 0.99.201
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.
- checksums.yaml +4 -4
- data/lib/ruby/riddl/utils/docoverlay.html +40 -9
- data/lib/ruby/riddl/wrapper.rb +7 -5
- data/lib/ruby/riddl/wrapper/declaration.rb +1 -1
- data/lib/ruby/riddl/wrapper/description.rb +1 -1
- data/riddl.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21c0e9e4bba99ce37d3853069628442dfd21ed25
|
|
4
|
+
data.tar.gz: 034b4367ae7b1d1432695585fcaba8b172080e37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46b8be50b6c6165955a95295719ec5fceaa6f4203d948e623340a96932b88b9ecd55c50fd641c190b1e816d31f49f9f54c14ed529d1cf271fcd30b5e70ad235e
|
|
7
|
+
data.tar.gz: 08e0bb4042364870e1c64b189cba34cc6e48a6827e255fc8e01d932e6745fe42f2917cf854d159fb67f39fe619334af8c47e519fcb1a15ba48006b8d04855b6b
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
content: counter(h1counter) "." counter(h2counter) ".\0000a0\0000a0";
|
|
22
22
|
counter-increment: h2counter;
|
|
23
23
|
}
|
|
24
|
+
.code {
|
|
25
|
+
border: 1px dashed #425d73; background-color: #DEE6EE; margin:0px; padding: 0.5em 1em; font-family: monospace; font-size:0.9em;
|
|
26
|
+
}
|
|
24
27
|
</style>
|
|
25
28
|
|
|
26
29
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
|
@@ -43,6 +46,33 @@
|
|
|
43
46
|
return out;
|
|
44
47
|
};
|
|
45
48
|
|
|
49
|
+
function docChildren(path,name,data){
|
|
50
|
+
var ret= [];
|
|
51
|
+
var subject = path ? $(path,data) : $(data);
|
|
52
|
+
subject.children().each(function(k,ele){
|
|
53
|
+
if (ele.localName == name && ele.namespaceURI == "http://riddl.org/ns/documentation/1.0") {
|
|
54
|
+
ret.push(ele);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return $(ret);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function codeFormat(temp) {
|
|
61
|
+
temp = temp.replace(/\&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'");
|
|
62
|
+
temp = temp.replace(/\t/g,' ');
|
|
63
|
+
temp = temp.replace(/\r/g,'');
|
|
64
|
+
temp = temp.replace(/^$/g,' ');
|
|
65
|
+
temp = temp.replace(/^ */gm,function mf(m){
|
|
66
|
+
var tm = (m.length + 2) * 0.6 + 2 * 0.6;
|
|
67
|
+
return "<div style='text-indent:-" + tm + "em;margin-left:" + tm + "em'>" + (Array(m.length + 1).join(" "));
|
|
68
|
+
});
|
|
69
|
+
temp = temp.replace(/ /g,"  ");
|
|
70
|
+
temp = temp.replace(/\n/g,"</div>\n");
|
|
71
|
+
temp += "</div>\n";
|
|
72
|
+
temp = temp.replace(/href="([^&]+)"/g,'href="<a href="/__doc_includes/$1">$1</a>"')
|
|
73
|
+
return temp;
|
|
74
|
+
}
|
|
75
|
+
|
|
46
76
|
$(document).ready(function(){
|
|
47
77
|
var rpath = "<%= @h['RIDDL_DECLARATION_PATH'] %>";
|
|
48
78
|
var pathele = _.compact(rpath.split('/'));
|
|
@@ -60,15 +90,16 @@
|
|
|
60
90
|
$.ajax({
|
|
61
91
|
url: rpath + "?riddl-resource-description",
|
|
62
92
|
success: function(data){
|
|
63
|
-
$('#main').append(marked(
|
|
93
|
+
$('#main').append(marked(docChildren('description > resource','documentation',data).text()));
|
|
64
94
|
|
|
65
95
|
var subr = $('description > resource > resource',data);
|
|
66
96
|
if (subr.length == 0) {
|
|
67
97
|
$('#subresources').remove();
|
|
68
98
|
} else {
|
|
69
99
|
$('description > resource > resource',data).each(function(k,ele){
|
|
70
|
-
var sum =
|
|
71
|
-
var exa =
|
|
100
|
+
var sum = docChildren(null,'documentation',ele).attr('summary');
|
|
101
|
+
var exa = docChildren(null,'example',ele);
|
|
102
|
+
exa = exa.length == 0 ? null : exa.text();
|
|
72
103
|
if (exa) {
|
|
73
104
|
var rell = exa;
|
|
74
105
|
var relt = exa + ' (' + $(ele).attr('relative') + ')';
|
|
@@ -87,11 +118,11 @@
|
|
|
87
118
|
});
|
|
88
119
|
}
|
|
89
120
|
|
|
90
|
-
var oprs = $('description > resource >
|
|
121
|
+
var oprs = $('description > resource > get, description > resource > post, description > resource > put, description > resource > delete, description > resource > request',data);
|
|
91
122
|
if (oprs.length == 0) {
|
|
92
123
|
$('#operations').remove();
|
|
93
124
|
} else {
|
|
94
|
-
|
|
125
|
+
oprs.each(function(k,ele){
|
|
95
126
|
var sum = $('documentation',ele).attr('summary');
|
|
96
127
|
var details = $('documentation',ele).text();
|
|
97
128
|
var tin = $(ele).attr('in');
|
|
@@ -159,12 +190,12 @@
|
|
|
159
190
|
}
|
|
160
191
|
|
|
161
192
|
if (tin && tin != "*") {
|
|
162
|
-
$('.input .message',clone).
|
|
193
|
+
$('.input .message',clone).html(codeFormat(vkbeautify.xml($(tinmess).serializeXML(),' ')));
|
|
163
194
|
} else {
|
|
164
195
|
$('.input',clone).remove();
|
|
165
196
|
}
|
|
166
197
|
if (tout) {
|
|
167
|
-
$('.output .message',clone).
|
|
198
|
+
$('.output .message',clone).html(codeFormat(vkbeautify.xml($(toutmess).serializeXML(),' ')));
|
|
168
199
|
} else {
|
|
169
200
|
$('.output',clone).remove();
|
|
170
201
|
}
|
|
@@ -187,11 +218,11 @@
|
|
|
187
218
|
<p class="text"></p>
|
|
188
219
|
<div class="input">
|
|
189
220
|
<h3>Input</h3>
|
|
190
|
-
<
|
|
221
|
+
<div class='message code'></div>
|
|
191
222
|
</div>
|
|
192
223
|
<div class="output">
|
|
193
224
|
<h3>Output</h3>
|
|
194
|
-
<
|
|
225
|
+
<div class='message code'></div>
|
|
195
226
|
</div>
|
|
196
227
|
</section>
|
|
197
228
|
</template>
|
data/lib/ruby/riddl/wrapper.rb
CHANGED
|
@@ -8,23 +8,24 @@ module Riddl
|
|
|
8
8
|
class WrapperUtils
|
|
9
9
|
def get_resource_deep(path,pres)
|
|
10
10
|
#{{{
|
|
11
|
-
path.split('/').each do |pa|
|
|
11
|
+
path.split('/(').each do |pa|
|
|
12
|
+
pa.chop!
|
|
12
13
|
next if pa == ""
|
|
13
14
|
if pres.resources.has_key?(pa)
|
|
14
15
|
pres = pres.resources[pa]
|
|
15
16
|
else
|
|
16
17
|
return nil
|
|
17
18
|
end
|
|
18
|
-
end
|
|
19
|
+
end unless path == '/'
|
|
19
20
|
pres
|
|
20
21
|
#}}}
|
|
21
22
|
end
|
|
22
|
-
def rpaths(res,what)
|
|
23
|
+
def rpaths(res,what,finalize=false)
|
|
23
24
|
#{{{
|
|
24
|
-
what += what == '' ? '/' : res.path
|
|
25
|
+
what += what == '' ? '/' : (finalize ? '(' + res.path + ')' : res.path)
|
|
25
26
|
ret = [[what,res.recursive]]
|
|
26
27
|
res.resources.each do |name,r|
|
|
27
|
-
ret += rpaths(r,what == '/' ? what : what + '/')
|
|
28
|
+
ret += rpaths(r,what == '/' ? what : what + '/',finalize)
|
|
28
29
|
end
|
|
29
30
|
ret.sort!
|
|
30
31
|
ret
|
|
@@ -265,6 +266,7 @@ module Riddl
|
|
|
265
266
|
description
|
|
266
267
|
declaration
|
|
267
268
|
tmp = []
|
|
269
|
+
|
|
268
270
|
tmp = @description.paths if @is_description
|
|
269
271
|
tmp = @declaration.paths if @is_declaration
|
|
270
272
|
tmp.map do |t|
|
data/riddl.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: riddl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.99.
|
|
4
|
+
version: 0.99.201
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: tools
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xml-smart
|