riddl 0.99.209 → 0.99.210
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/examples/pass-test/ara.xml +13 -0
- data/examples/pass-test/middleware.xml +25 -0
- data/examples/pass-test/oc.xml +7 -0
- data/examples/pass-test/structure.xml +19 -0
- data/lib/ruby/riddl/client.rb +2 -3
- data/lib/ruby/riddl/ns/declaration/1.0/declaration.rng +0 -5
- data/lib/ruby/riddl/wrapper.rb +1 -1
- data/lib/ruby/riddl/wrapper/declaration.rb +26 -16
- data/lib/ruby/riddl/wrapper/declaration/facade.rb +2 -8
- data/lib/ruby/riddl/wrapper/declaration/interface.rb +3 -3
- data/lib/ruby/riddl/wrapper/declaration/tile.rb +1 -1
- data/lib/ruby/riddl/wrapper/description/resource.rb +1 -1
- data/ns/declaration/1.0/declaration.rng +0 -5
- data/riddl.gemspec +1 -1
- data/test/smartrunner.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d987ba3153ddd4aed09c49d19d3f1f215fac5f2a
|
|
4
|
+
data.tar.gz: 81d2e1b295d19278a38ac57856d918b499eeee18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1995a0ed8cf92c555b896861cfbdd0588622e1bbe608cec2170bb3020973123bd760b53c0730d1643abbba1082241cbd9c3c9fdefe8473a36f102055e7e0cbb3
|
|
7
|
+
data.tar.gz: ef36ba2b110e3cef939ae8797065818e9f8a12c4b50b624442aa5052c9339ad339d522ce7f0da34c594720f073068bb3ed9f950c0fcbea0c2d9425658df22270
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:doc="http://riddl.org/ns/documentation/1.0">
|
|
2
|
+
|
|
3
|
+
<message name="aaaa">
|
|
4
|
+
<parameter name="aaaa" type="string">
|
|
5
|
+
<param name="pattern">\d{4}[SW]</param>
|
|
6
|
+
</parameter>
|
|
7
|
+
</message>
|
|
8
|
+
|
|
9
|
+
<resource>
|
|
10
|
+
<get out="aaaa"/>
|
|
11
|
+
</resource>
|
|
12
|
+
|
|
13
|
+
</description>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<declaration xmlns="http://riddl.org/ns/declaration/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
2
|
+
<interface name="structure">
|
|
3
|
+
<xi:include href="structure.xml"/>
|
|
4
|
+
</interface>
|
|
5
|
+
<interface name="oauth2-univie-client">
|
|
6
|
+
<xi:include href="oc.xml"/>
|
|
7
|
+
</interface>
|
|
8
|
+
<interface name="ara">
|
|
9
|
+
<xi:include href="ara.xml"/>
|
|
10
|
+
</interface>
|
|
11
|
+
|
|
12
|
+
<facade>
|
|
13
|
+
<tile>
|
|
14
|
+
<layer name="oauth2-univie-client">
|
|
15
|
+
<apply-to>/**/*</apply-to>
|
|
16
|
+
</layer>
|
|
17
|
+
<layer name="structure"/>
|
|
18
|
+
</tile>
|
|
19
|
+
<tile>
|
|
20
|
+
<layer name="ara">
|
|
21
|
+
<apply-to>/**/*</apply-to>
|
|
22
|
+
</layer>
|
|
23
|
+
</tile>
|
|
24
|
+
</facade>
|
|
25
|
+
</declaration>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:doc="http://riddl.org/ns/documentation/1.0">
|
|
2
|
+
|
|
3
|
+
<resource>
|
|
4
|
+
<get pass="*"/>
|
|
5
|
+
</resource>
|
|
6
|
+
|
|
7
|
+
</description>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:doc="http://riddl.org/ns/documentation/1.0">
|
|
2
|
+
|
|
3
|
+
<message name="currentsemester">
|
|
4
|
+
<parameter name="return" type="string">
|
|
5
|
+
<param name="pattern">\d{4}[SW]</param>
|
|
6
|
+
</parameter>
|
|
7
|
+
</message>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<resource>
|
|
11
|
+
<resource relative="currentsemester">
|
|
12
|
+
<get in="*" out="currentsemester"/>
|
|
13
|
+
<resource relative="currentsemester">
|
|
14
|
+
<get in="*" out="currentsemester"/>
|
|
15
|
+
</resource>
|
|
16
|
+
</resource>
|
|
17
|
+
</resource>
|
|
18
|
+
|
|
19
|
+
</description>
|
data/lib/ruby/riddl/client.rb
CHANGED
|
@@ -300,7 +300,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
|
300
300
|
|
|
301
301
|
qparams = extract_qparams(parameters,riddl_method.downcase)
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
response = nil
|
|
304
304
|
if @wrapper.nil? || @wrapper.description? || (@wrapper.declaration? && !@base.nil?)
|
|
305
305
|
status, response, response_headers = make_request(@base + @rpath,riddl_method,parameters,headers,qparams,simulate,riddl_message && riddl_message.out ? true : false)
|
|
306
306
|
return response if simulate
|
|
@@ -360,14 +360,13 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
|
360
360
|
req = Riddl::Client::HTTPRequest.new(riddl_method,url.path,parameters,headers,qs)
|
|
361
361
|
return req.simulate if simulate
|
|
362
362
|
|
|
363
|
-
|
|
363
|
+
response = nil
|
|
364
364
|
|
|
365
365
|
http = Net::HTTP.new(url.host, url.port)
|
|
366
366
|
if url.class == URI::HTTPS
|
|
367
367
|
http.use_ssl = true
|
|
368
368
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
369
369
|
end
|
|
370
|
-
deb = nil
|
|
371
370
|
if @options[:debug]
|
|
372
371
|
http.set_debug_output @options[:debug]
|
|
373
372
|
end
|
|
@@ -53,11 +53,6 @@
|
|
|
53
53
|
<attribute name="name">
|
|
54
54
|
<ref name="riddl-datatype-name"/>
|
|
55
55
|
</attribute>
|
|
56
|
-
<optional>
|
|
57
|
-
<attribute name="everywhere">
|
|
58
|
-
<data type="boolean"/>
|
|
59
|
-
</attribute>
|
|
60
|
-
</optional>
|
|
61
56
|
<zeroOrMore>
|
|
62
57
|
<element name="apply-to">
|
|
63
58
|
<ref name="riddl-datatype-pathtemplate"/>
|
data/lib/ruby/riddl/wrapper.rb
CHANGED
|
@@ -124,7 +124,7 @@ module Riddl
|
|
|
124
124
|
@doc.root.prepend("dec:interface",:name=>"riddldescription").add XML::Smart::open_unprotected(RIDDL_DESCRIPTION_SHOW).root
|
|
125
125
|
@doc.root.prepend("dec:interface",:name=>"riddlresourcedescription").add XML::Smart::open_unprotected(RIDDL_DESCRIPTION_RESOURCE_SHOW).root
|
|
126
126
|
@doc.root.find("dec:facade").first.append('dec:tile').append("layer",:name => "riddldescription")
|
|
127
|
-
@doc.root.find("dec:facade").first.append('dec:tile').append("layer",:name => "riddlresourcedescription"
|
|
127
|
+
@doc.root.find("dec:facade").first.append('dec:tile').append("layer",:name => "riddlresourcedescription").append("apply-to","/**/*")
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
@declaration = @description = nil
|
|
@@ -71,34 +71,44 @@ module Riddl
|
|
|
71
71
|
@tiles << (til = Tile.new)
|
|
72
72
|
res = til.base_path(tile.attributes['path'] || '/')
|
|
73
73
|
# res.clean! # for overlapping tiles, each tile gets an empty path TODO
|
|
74
|
+
later = []
|
|
74
75
|
tile.find("dec:layer").each_with_index do |layer,index|
|
|
75
76
|
apply_to = layer.find("dec:apply-to")
|
|
76
77
|
block = layer.find("dec:block")
|
|
77
78
|
|
|
78
|
-
everywhere = layer.attributes['everywhere'] == 'true'
|
|
79
79
|
lname = layer.attributes['name']
|
|
80
80
|
lpath, des = @interfaces[lname]
|
|
81
81
|
desres = des.find("des:resource").first
|
|
82
|
-
if
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
int = Interface.new(lname,path,lpath,"/",des)
|
|
87
|
-
rec = desres.attributes['recursive']
|
|
88
|
-
til.add_description(des,desres,path,index,int,block,rec)
|
|
89
|
-
end
|
|
82
|
+
if apply_to.empty?
|
|
83
|
+
int = Interface.new(lname,"/",lpath,"/",des)
|
|
84
|
+
rec = desres.attributes['recursive']
|
|
85
|
+
til.add_description(des,desres,"/",index,int,block,rec)
|
|
90
86
|
else
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
apply_to.each do |at|
|
|
87
|
+
apply_to.each do |at|
|
|
88
|
+
t = at.to_s.sub(/^\/*/,'').split(/(?<!\*\*)\//)
|
|
89
|
+
if t.last == "**/*" || t.last == "*"
|
|
90
|
+
later << [des,desres,lname,lpath,at.to_s.strip,index,block,t.last == "**/*" ? :descendants : :children]
|
|
91
|
+
else
|
|
97
92
|
int = Interface.new(lname,at.to_s,lpath,"/",des)
|
|
98
93
|
til.add_description(des,desres,at.to_s,index,int,block)
|
|
99
94
|
end
|
|
100
95
|
end
|
|
101
|
-
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
paths = @tiles.map do |til| # extract all currently existing paths for all tiles
|
|
99
|
+
rpaths(til.resource).map{|a,b| a}
|
|
100
|
+
end.flatten.uniq
|
|
101
|
+
later.each do |lat|
|
|
102
|
+
mpath = lat[4].gsub(/\/\*\*\/\*$/,'').gsub(/\/\*$/,'')
|
|
103
|
+
paths.each do |path|
|
|
104
|
+
pbefore, pafter = path[0..mpath.length].chop, path[mpath.length+1..-1]
|
|
105
|
+
if mpath == pbefore
|
|
106
|
+
if (lat[7] == :descendants && pafter != '') || (lat[7] == :children && !pafter.nil? && pafter != '' && pafter !~ /\//)
|
|
107
|
+
int = Interface.new(lat[2],path,lat[3],"/",lat[1])
|
|
108
|
+
til.add_description(lat[0],lat[1],path,lat[5],int,lat[6])
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
102
112
|
end
|
|
103
113
|
til.compose!
|
|
104
114
|
end
|
|
@@ -58,16 +58,10 @@ module Riddl
|
|
|
58
58
|
fac.composition[method] += s
|
|
59
59
|
end
|
|
60
60
|
res.resources.each do |path,r|
|
|
61
|
-
if !fac.resources.has_key?(path)
|
|
61
|
+
if !fac.resources.has_key?(path)
|
|
62
62
|
fac.resources[path] = Riddl::Wrapper::Description::Resource.new(path,r.recursive)
|
|
63
63
|
end
|
|
64
|
-
|
|
65
|
-
merge_tiles_to_all(r,fac)
|
|
66
|
-
elsif path == '*'
|
|
67
|
-
merge_tiles_to_layer(r,fac)
|
|
68
|
-
else
|
|
69
|
-
merge_tiles(r,fac.resources[path])
|
|
70
|
-
end
|
|
64
|
+
merge_tiles(r,fac.resources[path])
|
|
71
65
|
end
|
|
72
66
|
#}}}
|
|
73
67
|
end
|
|
@@ -16,9 +16,9 @@ module Riddl
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def real_path(real)
|
|
19
|
-
t = @top.
|
|
20
|
-
real = real.
|
|
21
|
-
real =
|
|
19
|
+
t = @top.split('/')
|
|
20
|
+
real = real.split('/')
|
|
21
|
+
real = real[t.length..-1]
|
|
22
22
|
'/' + real.join('/')
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -76,7 +76,7 @@ module Riddl
|
|
|
76
76
|
|
|
77
77
|
def add_path(path,pres,rec=nil)
|
|
78
78
|
#{{{
|
|
79
|
-
path.split(/
|
|
79
|
+
path.split('/').each do |pa|
|
|
80
80
|
next if pa == ""
|
|
81
81
|
unless pres.resources.has_key?(pa)
|
|
82
82
|
pres.resources[pa] = Riddl::Wrapper::Description::Resource.new(pa,rec.nil? ? false : true)
|
|
@@ -33,7 +33,7 @@ module Riddl
|
|
|
33
33
|
method = m.attributes['method'] || m.qname.name
|
|
34
34
|
add_request_star_out(index,interface,des,method,m.attributes['out'],m.find('*|text()'))
|
|
35
35
|
end
|
|
36
|
-
desres.find("des:*[not(name()='resource') and not(name()='websocket') and not(@in)]").each do |m|
|
|
36
|
+
desres.find("des:*[not(name()='resource') and not(name()='websocket') and not(@in) and not(@pass)]").each do |m|
|
|
37
37
|
method = m.attributes['method'] || m.qname.name
|
|
38
38
|
add_request_star_out(index,interface,des,method,m.attributes['out'],m.find('*|text()'))
|
|
39
39
|
end
|
|
@@ -53,11 +53,6 @@
|
|
|
53
53
|
<attribute name="name">
|
|
54
54
|
<ref name="riddl-datatype-name"/>
|
|
55
55
|
</attribute>
|
|
56
|
-
<optional>
|
|
57
|
-
<attribute name="everywhere">
|
|
58
|
-
<data type="boolean"/>
|
|
59
|
-
</attribute>
|
|
60
|
-
</optional>
|
|
61
56
|
<zeroOrMore>
|
|
62
57
|
<element name="apply-to">
|
|
63
58
|
<ref name="riddl-datatype-pathtemplate"/>
|
data/riddl.gemspec
CHANGED
data/test/smartrunner.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.210
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen 'eTM' Mangler
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: tools
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2016-04-
|
|
13
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: xml-smart
|
|
@@ -352,6 +352,10 @@ files:
|
|
|
352
352
|
- examples/notifications/topics.xml
|
|
353
353
|
- examples/oauth/oauth.rb
|
|
354
354
|
- examples/oauth/oauth.xml
|
|
355
|
+
- examples/pass-test/ara.xml
|
|
356
|
+
- examples/pass-test/middleware.xml
|
|
357
|
+
- examples/pass-test/oc.xml
|
|
358
|
+
- examples/pass-test/structure.xml
|
|
355
359
|
- examples/properties/description.conf
|
|
356
360
|
- examples/properties/description.rb
|
|
357
361
|
- examples/properties/properties.xml
|