riddl 0.99.114 → 0.99.115
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.
- data/lib/riddl/client.rb +8 -8
- data/lib/riddl/protocols/xmpp/generator.rb +2 -2
- data/lib/riddl/wrapper.rb +2 -2
- data/riddl.gemspec +1 -1
- metadata +2 -2
data/lib/riddl/client.rb
CHANGED
@@ -251,7 +251,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
251
251
|
|
252
252
|
res = response = nil
|
253
253
|
if @wrapper.nil? || @wrapper.description? || (@wrapper.declaration? && !@base.nil?)
|
254
|
-
status, response, response_headers = make_request(@base + @rpath,riddl_method,parameters,headers,qparams,simulate,riddl_message && riddl_message.out)
|
254
|
+
status, response, response_headers = make_request(@base + @rpath,riddl_method,parameters,headers,qparams,simulate,riddl_message && riddl_message.out ? true : false)
|
255
255
|
return response if simulate
|
256
256
|
if !@wrapper.nil? && status == 200
|
257
257
|
unless @wrapper.check_message(response,response_headers,riddl_message.out)
|
@@ -261,7 +261,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
261
261
|
elsif !@wrapper.nil? && @base.nil? && @wrapper.declaration?
|
262
262
|
headers['RIDDL-DECLARATION-PATH'] = @rpath
|
263
263
|
if !riddl_message.route?
|
264
|
-
status, response, response_headers = make_request(riddl_message.interface.real_url(@rpath,@base),riddl_method,parameters,headers,qparams,simulate,riddl_message && riddl_message.out)
|
264
|
+
status, response, response_headers = make_request(riddl_message.interface.real_url(@rpath,@base),riddl_method,parameters,headers,qparams,simulate,riddl_message && riddl_message.out ? true : false)
|
265
265
|
return response if simulate
|
266
266
|
if status == 200
|
267
267
|
unless @wrapper.check_message(response,response_headers,riddl_message.out)
|
@@ -274,7 +274,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
274
274
|
tq = qparams
|
275
275
|
riddl_message.route.each do |m|
|
276
276
|
if m == riddl_message.route.last
|
277
|
-
status, response, response_headers = make_request(m.interface.real_url(@rpath,@base),riddl_method,tp,th,tq,simulate,riddl_message && riddl_message.out)
|
277
|
+
status, response, response_headers = make_request(m.interface.real_url(@rpath,@base),riddl_method,tp,th,tq,simulate,riddl_message && riddl_message.out ? true : false)
|
278
278
|
else
|
279
279
|
status, response, response_headers = make_request(m.interface.real_url(@rpath,@base),riddl_method,tp,th,tq,simulate,true)
|
280
280
|
end
|
@@ -301,7 +301,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
301
301
|
end #}}}
|
302
302
|
private :exec_request
|
303
303
|
|
304
|
-
def make_request(url,riddl_method,parameters,headers,qparams,simulate,
|
304
|
+
def make_request(url,riddl_method,parameters,headers,qparams,simulate,ack) #{{{
|
305
305
|
url = URI.parse(url)
|
306
306
|
qs = qparams.join('&')
|
307
307
|
if url.class == URI::HTTP || url.class == URI::HTTPS
|
@@ -359,7 +359,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
359
359
|
#}}}
|
360
360
|
elsif url.class == URI::Generic && url.scheme.downcase == 'xmpp'
|
361
361
|
#{{{
|
362
|
-
req = Riddl::Client::XMPPRequest.new(riddl_method,url.user + "@" + url.host,url.path,parameters,headers,qs)
|
362
|
+
req = Riddl::Client::XMPPRequest.new(riddl_method,url.user + "@" + url.host,url.path,parameters,headers,qs,ack)
|
363
363
|
return req.simulate if simulate
|
364
364
|
|
365
365
|
sig = SignalWait.new
|
@@ -370,7 +370,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
370
370
|
status = 404
|
371
371
|
response = []
|
372
372
|
response_headers = {}
|
373
|
-
if
|
373
|
+
if ack
|
374
374
|
@options[:xmpp].write_with_handler(stanza) do |raw|
|
375
375
|
res = XML::Smart::Dom::Element.new(raw).parent
|
376
376
|
@options[:debug].puts(res.to_s) if @options[:debug]
|
@@ -428,10 +428,10 @@ unless Module.constants.include?('CLIENT_INCLUDED')
|
|
428
428
|
class XMPPRequest #{{{
|
429
429
|
attr_reader :stanza
|
430
430
|
|
431
|
-
def initialize(method, to, path, parameters, headers, qs)
|
431
|
+
def initialize(method, to, path, parameters, headers, qs, ack)
|
432
432
|
path = (path.strip == '' ? '/' : path)
|
433
433
|
path += "?#{qs}" unless qs == ''
|
434
|
-
@stanza = Protocols::XMPP::Generator.new(method,parameters,headers).generate
|
434
|
+
@stanza = Protocols::XMPP::Generator.new(method,parameters,headers,ack).generate
|
435
435
|
@stanza.to = to + path
|
436
436
|
end
|
437
437
|
|
@@ -55,14 +55,14 @@ module Riddl
|
|
55
55
|
end
|
56
56
|
|
57
57
|
class Generator
|
58
|
-
def initialize(what,params,headers)
|
58
|
+
def initialize(what,params,headers,ack=false)
|
59
59
|
@params = params
|
60
60
|
@stanza = Stanza.new
|
61
61
|
@node = XML::Smart::Dom::Element.new(@stanza)
|
62
62
|
if what.is_a?(Fixnum)
|
63
63
|
@node.add('ok').namespaces.add(nil,XR_NS)
|
64
64
|
else
|
65
|
-
@node.add('operation',what).namespaces.add(nil,XR_NS)
|
65
|
+
@node.add('operation',what,:ack=>ack).namespaces.add(nil,XR_NS)
|
66
66
|
end
|
67
67
|
headers.each do |k,v|
|
68
68
|
@node.add('header',v,:name => k).namespaces.add(nil,XR_NS)
|
data/lib/riddl/wrapper.rb
CHANGED
@@ -104,10 +104,10 @@ module Riddl
|
|
104
104
|
@doc.root.prepend rds.find('/xmlns:description/xmlns:message')
|
105
105
|
@doc.root.prepend rrds.find('/xmlns:description/xmlns:message')
|
106
106
|
@doc.find("/des:description/des:resource").each do |r|
|
107
|
-
r.
|
107
|
+
r.prepend rds.find('/xmlns:description/xmlns:resource/*')
|
108
108
|
end
|
109
109
|
@doc.find("/des:description//des:resource").each do |r|
|
110
|
-
r.
|
110
|
+
r.prepend rrds.find('/xmlns:description/xmlns:resource/*')
|
111
111
|
end
|
112
112
|
end
|
113
113
|
if @is_declaration && get_description
|
data/riddl.gemspec
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.115
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xml-smart
|