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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a09958851c3d72d1bd539ccc1b8e236917f2c3b
4
- data.tar.gz: 328c47ad7802b4516a059c61f531535d96baf80d
3
+ metadata.gz: d987ba3153ddd4aed09c49d19d3f1f215fac5f2a
4
+ data.tar.gz: 81d2e1b295d19278a38ac57856d918b499eeee18
5
5
  SHA512:
6
- metadata.gz: b302daa4b3ef2505b64f63d8ec7fb9093b8f95b0245e38a9da43d166076bf0036509cce5ee7d2c60ae025e34dbcb4bda3540baac28b7128b07e01c9371c203ef
7
- data.tar.gz: 3de64c01df01dac35e258f16e4ee60f3bb0a415d725b59ab71e06c94b1228d194e3989faba49394e3daac80efb51c28557f55e9f0335189fc683a4318e24d3be
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>
@@ -300,7 +300,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
300
300
 
301
301
  qparams = extract_qparams(parameters,riddl_method.downcase)
302
302
 
303
- res = response = nil
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
- res = response = nil
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"/>
@@ -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",:everywhere => 'true')
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 everywhere
83
- @tiles.map do |til| # extract all currently existing paths for all tiles
84
- rpaths(til.resource).map{|a,b| a}
85
- end.flatten.uniq.each do |path| # apply current to all paths
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
- if apply_to.empty?
92
- int = Interface.new(lname,"/",lpath,"/",des)
93
- rec = desres.attributes['recursive']
94
- til.add_description(des,desres,"/",index,int,block,rec)
95
- else
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) && path != '**/*' && 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
- if path == '**/*'
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.sub(/^\/*/,'').split(/(?<!\*\*)\//)
20
- real = real.sub(/^\/*/,'').split('/')
21
- real = t.last == "**/*" ? [] : real[t.length..-1]
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(/(?<!\/\*\*)\//).each do |pa| # match a slash not preceeded by **
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"/>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.99.209"
3
+ s.version = "0.99.210"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "restful interface description and declaration language: tools and client/server libs"
@@ -30,7 +30,7 @@ module ServerCase
30
30
  begin
31
31
  TCPSocket.new('localhost', s.port)
32
32
  up = true
33
- rescue => e
33
+ rescue
34
34
  sleep 0.2
35
35
  end
36
36
  end
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.209
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-27 00:00:00.000000000 Z
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