lib/cpee/instantiation.rb in cpee-1.5.25 vs lib/cpee/instantiation.rb in cpee-1.5.26
- old
+ new
@@ -32,11 +32,11 @@
uuid = nil
XML::Smart.string(tdoc) do |doc|
doc.register_namespace 'desc', 'http://cpee.org/ns/description/1.0'
doc.register_namespace 'prop', 'http://riddl.org/ns/common-patterns/properties/1.0'
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/")
if name
doc.find("/testset/attributes/prop:info").each do |e|
e.text = name
end
@@ -107,11 +107,11 @@
@headers << Riddl::Header.new('CPEE-CALLBACK','true')
cb = @h['CPEE_CALLBACK']
if cb
cbk = SecureRandom.uuid
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
status, response = srv.resource("/#{instance}/notifications/subscriptions/").post [
Riddl::Parameter::Simple.new("url",File.join(selfurl,'callback',cbk)),
Riddl::Parameter::Simple.new("topic","state"),
Riddl::Parameter::Simple.new("events","change")
]
@@ -124,11 +124,11 @@
end
end #}}}
private :handle_waiting
def handle_starting(cpee,instance,behavior) #{{{
if behavior =~ /_running$/
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/#{instance}/properties/values")
status, response = res.put [
Riddl::Parameter::Simple.new('name', 'state'),
Riddl::Parameter::Simple.new('value','running')
]
@@ -139,11 +139,11 @@
if data && !data.empty?
content = XML::Smart.string('<content/>')
JSON::parse(data).each do |k,v|
content.root.add(k,v)
end
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/#{instance}/properties/values/dataelements/")
status, response = res.patch [
Riddl::Parameter::Complex.new('content','text/xml',content.to_s)
]
end rescue nil
@@ -152,11 +152,11 @@
if data && !data.empty?
content = XML::Smart.string('<content/>')
JSON::parse(data).each do |k,v|
content.root.add(k,v)
end
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/#{instance}/properties/values/endpoints/")
status, response = res.patch [
Riddl::Parameter::Complex.new('content','text/xml',content.to_s)
]
end rescue nil
@@ -278,11 +278,11 @@
cpee = @h['X_CPEE'] || @a[0]
selfurl = @a[1]
cblist = @a[2]
instance = @p[1].value
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/#{instance}/properties/values/attributes/uuid")
status, response = res.get
if status >= 200 && status < 300
uuid = XML::Smart::string(response.first.value).root.text
@@ -314,10 +314,10 @@
}
send = orisend.dup
if notification['state'] == condition
cblist.del(key)
- srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
res = srv.resource("/#{instance}/properties/values/dataelements")
status, response = res.get
if status >= 200 && status < 300
doc = XML::Smart.string(response[0].value.read)
doc.register_namespace 'p', 'http://riddl.org/ns/common-patterns/properties/1.0'