riddl 0.101.24 → 0.105
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/declaration-server-distributed/declaration.rb +1 -1
- data/examples/declaration-server-distributed/declaration.xml +4 -4
- data/examples/declaration-server-distributed/main.rb +4 -4
- data/examples/declaration-server-distributed/properties.rb +5 -5
- data/examples/declaration-server-distributed/xsloverlay.rb +1 -1
- data/examples/declaration-server-hybrid/declaration.rb +6 -6
- data/examples/declaration-server-hybrid/declaration.xml +2 -2
- data/examples/declaration-server-hybrid/xsloverlay.rb +1 -1
- data/examples/declaration-server-local/declaration.rb +5 -5
- data/examples/declaration-test/main.rb +5 -5
- data/examples/downloadify/client.rb +1 -1
- data/examples/downloadify/server.rb +2 -2
- data/examples/flickr/declaration.xml +1 -1
- data/examples/helloworld/declaration-definition_goal.xml +1 -3
- data/examples/helloworld/description.xml +5 -7
- data/examples/library/description.xml +5 -5
- data/examples/library/server.rb +1 -1
- data/examples/notifications/producer.rb +3 -3
- data/examples/properties/server.properties.xml +1 -1
- data/lib/ruby/riddl/handlers/plain-type.rb +7 -6
- data/lib/ruby/riddl/ns/common-patterns/notifications-consumer/2.0/consumer.xml +12 -12
- data/lib/ruby/riddl/protocols/http/parser.rb +12 -5
- data/lib/ruby/riddl/server.rb +11 -1
- data/lib/ruby/riddl/wrapper.rb +12 -5
- data/ns/common-patterns/notifications-consumer/2.0/consumer.xml +12 -12
- data/riddl.gemspec +3 -3
- data/test/smartrunner.rb +21 -14
- data/test/tc_declaration-distributed.rb +1 -0
- data/test/tc_websocket.rb +16 -15
- metadata +8 -19
- data/examples/properties/properties.schema.xsl +0 -1
- data/examples/xmpp/blather/description.xml +0 -981
- data/examples/xmpp/blather/direct.rb +0 -44
- data/examples/xmpp/blather/load.rb +0 -18
- data/examples/xmpp/blather/pp.rb +0 -40
- data/examples/xmpp/blather/test.rb +0 -32
- data/examples/xmpp/client.rb +0 -20
- data/examples/xmpp/description.rb +0 -17
- data/examples/xmpp/properties.xml +0 -1
- data/examples/xmpp/server.properties.schema +0 -34
- data/examples/xmpp/server.properties.xml +0 -16
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
require 'rubygems'
|
4
|
-
require 'blather/client/dsl'
|
5
|
-
require 'xml/smart'
|
6
|
-
require 'pp'
|
7
|
-
|
8
|
-
XR_NS = 'http://riddl.org/ns/xmpp-rest'.freeze
|
9
|
-
|
10
|
-
class Stanza < Blather::Stanza
|
11
|
-
def self.new
|
12
|
-
node = super :message
|
13
|
-
node.type = :normal
|
14
|
-
node.id = SecureRandom.uuid
|
15
|
-
node
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
module Test
|
20
|
-
extend Blather::DSL
|
21
|
-
def self.run; client.run; end
|
22
|
-
|
23
|
-
setup 'jürgen@fp7-adventure.eu', 'mangler'
|
24
|
-
when_ready do
|
25
|
-
p 'sss'
|
26
|
-
stanza = Stanza.new
|
27
|
-
node = XML::Smart::Dom::Element.new(stanza)
|
28
|
-
stanza.to = "adventure_processinstantiation@fp7-adventure.eu"
|
29
|
-
n = node.add 'part', "a" * 1000045
|
30
|
-
n.namespaces.add(nil,XR_NS)
|
31
|
-
s = stanza.to_s
|
32
|
-
puts s.length
|
33
|
-
write_to_stream stanza
|
34
|
-
puts 'a'
|
35
|
-
sleep 10000
|
36
|
-
puts 'b'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
trap(:INT) { EM.stop }
|
41
|
-
trap(:TERM) { EM.stop }
|
42
|
-
EM.run do
|
43
|
-
Test.run
|
44
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
require 'rubygems'
|
4
|
-
require 'riddl/client'
|
5
|
-
|
6
|
-
srv = Riddl::Client.new("xmpp://adventure_processinstantiation@fp7-adventure.eu","http://fp7-adventure.eu:9296/?riddl-description",:jid => 'jürgen@fp7-adventure.eu', :pass => 'mangler', :debug => STDOUT)
|
7
|
-
res = srv.resource("/")
|
8
|
-
status, response = res.post [
|
9
|
-
Riddl::Parameter::Complex.new("xml","application/xml",File.read('description.xml')),
|
10
|
-
Riddl::Parameter::Simple.new("targetmode","ready")
|
11
|
-
]
|
12
|
-
p status
|
13
|
-
ins = response[0].value
|
14
|
-
p ins
|
15
|
-
|
16
|
-
res = srv.resource("/#{ins}")
|
17
|
-
status, response = res.get
|
18
|
-
p status
|
data/examples/xmpp/blather/pp.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'rubygems'
|
3
|
-
require 'blather/client/dsl'
|
4
|
-
$stdout.sync = true
|
5
|
-
|
6
|
-
module Ping
|
7
|
-
extend Blather::DSL
|
8
|
-
def self.run; client.run; end
|
9
|
-
|
10
|
-
setup 'jürgen@fp7-adventure.eu', 'mangler'
|
11
|
-
|
12
|
-
status do |s|
|
13
|
-
p s
|
14
|
-
puts "serve!"
|
15
|
-
say s.from, 'ping'
|
16
|
-
end
|
17
|
-
|
18
|
-
message :chat?, :body => 'pong' do |m|
|
19
|
-
puts "ping!"
|
20
|
-
say m.from, 'ping'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
module Pong
|
25
|
-
extend Blather::DSL
|
26
|
-
def self.run; client.run; end
|
27
|
-
|
28
|
-
setup 'adventure_processexecution@fp7-adventure.eu', 'adventure_processexecution'
|
29
|
-
message :chat?, :body => 'ping' do |m|
|
30
|
-
puts "pong!"
|
31
|
-
say m.from, 'pong'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
trap(:INT) { EM.stop }
|
36
|
-
trap(:TERM) { EM.stop }
|
37
|
-
EM.run do
|
38
|
-
Ping.run
|
39
|
-
Pong.run
|
40
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'rubygems'
|
3
|
-
require 'blather/client/dsl'
|
4
|
-
|
5
|
-
module App
|
6
|
-
extend Blather::DSL
|
7
|
-
|
8
|
-
def self.run
|
9
|
-
EM.run { client.run }
|
10
|
-
end
|
11
|
-
|
12
|
-
setup 'jürgen@fp7-adventure.eu', 'mangler'
|
13
|
-
|
14
|
-
when_ready do
|
15
|
-
puts "i'm ready"
|
16
|
-
end
|
17
|
-
|
18
|
-
# Auto approve subscription requests
|
19
|
-
subscription :request? do |s|
|
20
|
-
write_to_stream s.approve!
|
21
|
-
end
|
22
|
-
|
23
|
-
# Echo back what was said
|
24
|
-
message :chat?, :body do |m|
|
25
|
-
write_to_stream m.reply
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
trap(:INT) { EM.stop }
|
30
|
-
trap(:TERM) { EM.stop }
|
31
|
-
|
32
|
-
App.run
|
data/examples/xmpp/client.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
require '../../lib/ruby/riddl/client'
|
4
|
-
require 'pp'
|
5
|
-
|
6
|
-
#props = Riddl::Client.interface("http://localhost:9191","properties.xml")
|
7
|
-
props = Riddl::Client.interface("xmpp://adventure_processexecution@cpee.org", "properties.xml", :jid => 'juergen@cpee.org', :pass => 'mangler', :debug => STDOUT)
|
8
|
-
|
9
|
-
test = props.resource("/values/state")
|
10
|
-
status, res = test.get
|
11
|
-
puts status
|
12
|
-
p '---------'
|
13
|
-
|
14
|
-
if res[0].value == 'running'
|
15
|
-
status, res = test.put [ Riddl::Parameter::Simple.new("value","stopped") ]
|
16
|
-
else
|
17
|
-
status, res = test.put [ Riddl::Parameter::Simple.new("value","running") ]
|
18
|
-
end
|
19
|
-
|
20
|
-
puts status
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
require 'pp'
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/ruby/riddl/server')
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/ruby/riddl/utils/properties')
|
5
|
-
|
6
|
-
Riddl::Server.new(File.dirname(__FILE__) + '/properties.xml', :port => 9191) do |opts|
|
7
|
-
xmpp 'adventure_processexecution@cpee.org', 'adventure_processexecution'
|
8
|
-
|
9
|
-
backend = Riddl::Utils::Properties::Backend.new(
|
10
|
-
opts[:basepath] + '/server.properties.schema',
|
11
|
-
opts[:basepath] + '/server.properties.xml'
|
12
|
-
)
|
13
|
-
|
14
|
-
on resource do
|
15
|
-
use Riddl::Utils::Properties::implementation(backend)
|
16
|
-
end
|
17
|
-
end.loop!
|
@@ -1 +0,0 @@
|
|
1
|
-
../../ns/common-patterns/properties/1.0/properties.xml
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
-
<name type="simple" modifiable="false" mutable="false">
|
3
|
-
<text/>
|
4
|
-
</name>
|
5
|
-
<handlerwrapper type="simple" modifiable="false" mutable="false">
|
6
|
-
<data type="string">
|
7
|
-
<param name="pattern">[A-Z][a-zA-Z]*</param>
|
8
|
-
</data>
|
9
|
-
</handlerwrapper>
|
10
|
-
<description type="arbitrary" modifiable="false" mutable="false"/>
|
11
|
-
<optional>
|
12
|
-
<transformation type="arbitrary" modifiable="true" mutable="false"/>
|
13
|
-
</optional>
|
14
|
-
<state type="state" modifiable="true">
|
15
|
-
<running>
|
16
|
-
<stopped putable="true"/>
|
17
|
-
<finished putable="false"/>
|
18
|
-
</running>
|
19
|
-
<stopped>
|
20
|
-
<running putable="true"/>
|
21
|
-
</stopped>
|
22
|
-
<finished/>
|
23
|
-
</state>
|
24
|
-
<dataelements type="complex" modifiable="true" mutable="true">
|
25
|
-
<zeroOrMore>
|
26
|
-
<element><anyName/><text/></element>
|
27
|
-
</zeroOrMore>
|
28
|
-
</dataelements>
|
29
|
-
<endpoints type="complex" modifiable="false" mutable="true">
|
30
|
-
<zeroOrMore>
|
31
|
-
<element><anyName/><text/></element>
|
32
|
-
</zeroOrMore>
|
33
|
-
</endpoints>
|
34
|
-
</properties>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
-
<name>eTM</name>
|
3
|
-
<dataelements>
|
4
|
-
<a>7</a>
|
5
|
-
<b>7</b>
|
6
|
-
<c>foo</c>
|
7
|
-
</dataelements>
|
8
|
-
<endpoints>
|
9
|
-
<e1>http://www.heise.de</e1>
|
10
|
-
<e2>mager</e2>
|
11
|
-
</endpoints>
|
12
|
-
<handlerwrapper>Test</handlerwrapper>
|
13
|
-
<description>lala</description>
|
14
|
-
<state>running</state>
|
15
|
-
<transformation>xxx</transformation>
|
16
|
-
</properties>
|