riddl 0.101.26 → 0.107

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/examples/declaration-server-distributed/declaration.rb +1 -1
  3. data/examples/declaration-server-distributed/declaration.xml +4 -4
  4. data/examples/declaration-server-distributed/main.rb +4 -4
  5. data/examples/declaration-server-distributed/properties.rb +5 -5
  6. data/examples/declaration-server-distributed/xsloverlay.rb +1 -1
  7. data/examples/declaration-server-hybrid/declaration.rb +6 -6
  8. data/examples/declaration-server-hybrid/declaration.xml +2 -2
  9. data/examples/declaration-server-hybrid/xsloverlay.rb +1 -1
  10. data/examples/declaration-server-local/declaration.rb +5 -5
  11. data/examples/declaration-test/main.rb +5 -5
  12. data/examples/downloadify/client.rb +1 -1
  13. data/examples/downloadify/server.rb +2 -2
  14. data/examples/flickr/declaration.xml +1 -1
  15. data/examples/library/server.rb +1 -1
  16. data/examples/notifications/producer.rb +3 -3
  17. data/examples/properties/server.properties.xml +1 -1
  18. data/examples/sse/description.xml +1 -1
  19. data/lib/ruby/riddl/client.rb +1 -0
  20. data/lib/ruby/riddl/handlers/plain-type.rb +1 -1
  21. data/lib/ruby/riddl/ns/common-patterns/notifications-consumer/2.0/consumer.xml +4 -1
  22. data/lib/ruby/riddl/protocols/sse.rb +2 -2
  23. data/lib/ruby/riddl/server.rb +11 -1
  24. data/lib/ruby/riddl/wrapper.rb +12 -5
  25. data/ns/common-patterns/notifications-consumer/2.0/consumer.xml +4 -1
  26. data/riddl.gemspec +3 -3
  27. data/test/smartrunner.rb +21 -14
  28. data/test/tc_declaration-distributed.rb +1 -0
  29. data/test/tc_websocket.rb +16 -15
  30. metadata +12 -23
  31. data/examples/properties/properties.schema.xsl +0 -1
  32. data/examples/xmpp/blather/description.xml +0 -981
  33. data/examples/xmpp/blather/direct.rb +0 -44
  34. data/examples/xmpp/blather/load.rb +0 -18
  35. data/examples/xmpp/blather/pp.rb +0 -40
  36. data/examples/xmpp/blather/test.rb +0 -32
  37. data/examples/xmpp/client.rb +0 -20
  38. data/examples/xmpp/description.rb +0 -17
  39. data/examples/xmpp/properties.xml +0 -1
  40. data/examples/xmpp/server.properties.schema +0 -34
  41. 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
@@ -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
@@ -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>