riddl 0.99.226 → 0.99.227

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d6eca195cbeec3544fb4e192b66cf20f6c995de
4
- data.tar.gz: 6d7b88a519dffa4019c7d9ceff69cbc44ed54c42
3
+ metadata.gz: 531b59a0576b4c3c80c0982cc2cb3daa0a5c1937
4
+ data.tar.gz: 9f9333e701a95a927c151861fa9f067adbd0a1f7
5
5
  SHA512:
6
- metadata.gz: 73dd2bc985411195b256aeea27f7f66df3e7cb5aa45fc8a10a1ba661dc53528b67eddcd2c98c3466b5398504625051d47f59d84d692da291957bb8851a62578e
7
- data.tar.gz: 2be0a3d91d2c5ff68183c54aa9d854b15b0940c6c458cdb66c999b2a3cba46cef7a4a7b322b8bd68aa0f32e8f63142598e9079170fae27f90a6049b97c01267f
6
+ metadata.gz: 71ae7b32aefc5e9c9f8a934d8c070fc4754c9cc0697f7e4ea54ac6f1e8cf0227a071e0f7ad2640b55b28ff821ae3568a0fa2ac005fc391813158506adb91fe88
7
+ data.tar.gz: e80850aeef8cdd327af9aeaf3c0ded941a34eeb9f5a94386306459fc93bd71bbf2b15c92b26e5f7105ed7446befab36f561f69e273a99b62d09dc70cb6583157
@@ -298,7 +298,7 @@ module Riddl
298
298
  @riddl_path = '/'
299
299
  if m.interface.base.nil?
300
300
  if @riddl_interfaces.key? m.interface.name
301
- @riddl_info[:r] = m.interface.real_path(@riddl_pinfo).sub(/\/*/,'').split('/')
301
+ @riddl_info[:r] = m.interface.real_path(@riddl_pinfo).sub(/\//,'').split('/')
302
302
  @riddl_info[:h]['RIDDL_DECLARATION_PATH'] = @riddl_pinfo
303
303
  @riddl_info[:h]['RIDDL_DECLARATION_RESOURCE'] = m.interface.top
304
304
  @riddl_info[:s] = m.interface.sub.sub(/\//,'').split('/')
@@ -414,7 +414,7 @@ module Riddl
414
414
  @riddl_info = {
415
415
  :h => @riddl_headers,
416
416
  :p => @riddl_parameters,
417
- :r => @riddl_pinfo.sub(/\/*/,'').split('/').map{|e|Protocols::Utils::unescape(e)},
417
+ :r => @riddl_pinfo.sub(/\//,'').split('/').map{|e|Protocols::Utils::unescape(e)},
418
418
  :s => @riddl_matching_path[0].sub(/\//,'').split('/'),
419
419
  :m => @riddl_method,
420
420
  :env => @riddl_env.reject{|k,v| k =~ /^rack\./}.merge({'riddl.transport' => 'http', 'xmpp' => @riddl_opts[:xmpp]}),
@@ -3,6 +3,8 @@ module Riddl
3
3
  class Declaration < WrapperUtils
4
4
 
5
5
  class Facade
6
+ attr_reader :resource
7
+
6
8
  def initialize
7
9
  @resource = Riddl::Wrapper::Description::Resource.new("/")
8
10
  end
@@ -56,7 +58,7 @@ module Riddl
56
58
  res.composition.each do |method,s|
57
59
  fac.composition[method] ||= []
58
60
  fac.composition[method] += s
59
- end
61
+ end
60
62
  res.resources.each do |path,r|
61
63
  if !fac.resources.has_key?(path)
62
64
  fac.resources[path] = Riddl::Wrapper::Description::Resource.new(path,r.recursive)
@@ -65,28 +67,6 @@ module Riddl
65
67
  end
66
68
  #}}}
67
69
  end
68
-
69
- # recurse to all resources that currently exist in facade beneath the
70
- # current resource path, and merge the tile contents
71
- def merge_tiles_to_all(r,fac)
72
-
73
- fac.resources.keys.each do |fkey|
74
- merge_tiles(r,fac.resources[fkey])
75
- merge_tiles_to_all(r,fac.resources[fkey])
76
- end
77
- end
78
- private :merge_tiles_to_all
79
-
80
- # move to children in the facade (directly beneath the current resource
81
- # path), and merge the tile contents
82
- def merge_tiles_to_layer(r,fac)
83
- fac.resources.keys.each do |fkey|
84
- merge_tiles(r,fac.resources[fkey])
85
- end
86
- end
87
- private :merge_tiles_to_all
88
-
89
- attr_reader :resource
90
70
  end
91
71
 
92
72
  end
@@ -19,7 +19,7 @@ module Riddl
19
19
  t = @top.split('/')
20
20
  real = real.split('/')
21
21
  real = real[t.length..-1]
22
- '/' + real.join('/')
22
+ real.join('/')
23
23
  end
24
24
 
25
25
  def real_url(real,base)
@@ -137,24 +137,34 @@ module Riddl
137
137
  routes.map do |r|
138
138
  ret = nil
139
139
  teh_last = r.last
140
+ teh_first = r.first
141
+ lcount = r.size
142
+ fcount = 0
140
143
  begin
141
144
  success = true
142
- if r.first.respond_to?(:in) && teh_last.respond_to?(:out)
145
+ if teh_first.respond_to?(:in) && teh_last.respond_to?(:out)
143
146
  #1: responds first in + last out -> new InOut
144
- ret = RequestInOut.new_from_message(r.first.in,teh_last.out)
145
- elsif r.first.class == RequestTransformation && teh_last.class == RequestTransformation && teh_last.out.nil?
147
+ ret = RequestInOut.new_from_message(teh_first.in,teh_last.out)
148
+ elsif teh_first.class == RequestTransformation && teh_last.class == RequestTransformation && teh_last.out.nil?
146
149
  #2: first transform + last transform -> merge transformations
147
- ret = RequestTransformation.new_from_transformation(r.first.trans,teh_last.trans)
150
+ ret = RequestTransformation.new_from_transformation(teh_first.trans,teh_last.trans)
151
+ elsif teh_first.class == RequestPass
152
+ if r.size > (fcount + 1)
153
+ teh_first = r[fcount+=1]
154
+ success = false
155
+ else
156
+ ret = teh_last
157
+ end
148
158
  elsif teh_last.respond_to?(:out)
149
159
  #3: responds last out only -> new StarOut
150
160
  ret = RequestStarOut.new_from_message(teh_last.out)
151
161
  elsif teh_last.class == RequestPass
152
162
  #4: last pass -> remove last until #1 or #2 or #3 or size == 1
153
- if r.size > 1
154
- teh_last = r[-2]
163
+ if lcount - 1 > 0
164
+ teh_last = r[lcount -= 1]
155
165
  success = false
156
166
  else
157
- ret = teh_last
167
+ ret = teh_first
158
168
  end
159
169
  end
160
170
  end while !success
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.99.226"
3
+ s.version = "0.99.227"
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"
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.226
4
+ version: 0.99.227
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-29 00:00:00.000000000 Z
13
+ date: 2016-05-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: xml-smart