riddl 0.102 → 0.108
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/properties/server.properties.xml +1 -1
- data/examples/sse/description.xml +1 -1
- data/examples/sse/server.rb +2 -0
- data/lib/ruby/riddl/client.rb +1 -0
- data/lib/ruby/riddl/ns/common-patterns/notifications-consumer/2.0/consumer.xml +4 -1
- data/lib/ruby/riddl/protocols/sse.rb +8 -4
- data/lib/ruby/riddl/server.rb +11 -1
- data/ns/common-patterns/notifications-consumer/2.0/consumer.xml +4 -1
- data/riddl.gemspec +2 -2
- metadata +10 -11
- data/examples/properties/properties.schema.xsl +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba99e4436e3ca77f2ccd22e783ced04c42b84a2a3a90e5dc767b3912a0fe15b5
|
4
|
+
data.tar.gz: e6b7abac2cd99448e958a61748b2e16c39896747fb4011921ca67f2b53ac6ae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3855116333b18322255d788c92e3003c37813167266d24d15ca4d048113b4c57014c5eb8d8048e8492679a42f585bc86dcd04aee0d60982a135d4a4761adf946
|
7
|
+
data.tar.gz: c81120e0746794963fbe8c59498eb5fe15330c63149144a3800d6477402b7b41d88b710786ddf55b266737933a07737cd3f537a622d1533e1e09d45907161149
|
@@ -11,6 +11,6 @@
|
|
11
11
|
</endpoints>
|
12
12
|
<handlerwrapper>Test</handlerwrapper>
|
13
13
|
<description>lala</description>
|
14
|
-
<state changed="2020-10-
|
14
|
+
<state changed="2020-10-01T20:41:21+02:00">stopped</state>
|
15
15
|
<transformation>xxx</transformation>
|
16
16
|
</properties>
|
data/examples/sse/server.rb
CHANGED
@@ -10,6 +10,8 @@ end
|
|
10
10
|
|
11
11
|
class Echo < Riddl::SSEImplementation
|
12
12
|
def onopen
|
13
|
+
// if true (or any object for that matter) is returned, then 200 is sent
|
14
|
+
// if false (or nil) is returned 404, the sse is denied
|
13
15
|
puts "Connection established"
|
14
16
|
Thread.new do
|
15
17
|
1.upto 10 do |i|
|
data/lib/ruby/riddl/client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
2
2
|
|
3
3
|
<message name="event">
|
4
|
-
<parameter name="
|
4
|
+
<parameter name="key" type="string"/>
|
5
5
|
<parameter name="topic" type="string">
|
6
6
|
<param name="pattern">[\w_/]+</param>
|
7
7
|
</parameter>
|
@@ -12,6 +12,9 @@
|
|
12
12
|
<parameter name="notification" type="string"/>
|
13
13
|
<parameter name="notification" mimetype="application/json"/>
|
14
14
|
</choice>
|
15
|
+
<optional>
|
16
|
+
<parameter name="fingerprint-with-consumer-secret" type="string"/>
|
17
|
+
</optional>
|
15
18
|
</message>
|
16
19
|
|
17
20
|
<message name="vote">
|
@@ -33,8 +33,8 @@ module Riddl
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def trigger_on_open();
|
37
|
-
def trigger_on_close;
|
36
|
+
def trigger_on_open(); @closed = false; @app.onopen; end
|
37
|
+
def trigger_on_close; @closed = true; @app.onclose; end
|
38
38
|
|
39
39
|
def initialize(app, env)
|
40
40
|
@app = app
|
@@ -56,8 +56,12 @@ module Riddl
|
|
56
56
|
headers['Access-Control-Max-Age'] = '0'
|
57
57
|
end
|
58
58
|
EventMachine::next_tick {
|
59
|
-
|
60
|
-
|
59
|
+
if trigger_on_open
|
60
|
+
@env['async.callback'].call [200, headers, @body]
|
61
|
+
else
|
62
|
+
@body.fail
|
63
|
+
@env['async.callback'].call [404, headers, {}]
|
64
|
+
end
|
61
65
|
}
|
62
66
|
end
|
63
67
|
|
data/lib/ruby/riddl/server.rb
CHANGED
@@ -129,6 +129,14 @@ module Riddl
|
|
129
129
|
end
|
130
130
|
|
131
131
|
[:INT, :TERM].each do |signal|
|
132
|
+
Signal.trap(signal) do
|
133
|
+
if @riddl_opts[:cleanup]
|
134
|
+
@riddl_opts[:cleanup].call
|
135
|
+
end
|
136
|
+
EM.stop
|
137
|
+
end
|
138
|
+
end
|
139
|
+
[:HUP].each do |signal|
|
132
140
|
Signal.trap(signal) do
|
133
141
|
EM.stop
|
134
142
|
end
|
@@ -140,7 +148,6 @@ module Riddl
|
|
140
148
|
end
|
141
149
|
end
|
142
150
|
end
|
143
|
-
|
144
151
|
rescue => e
|
145
152
|
if @riddl_opts[:custom_protocol] && !@riddl_opts[:http_only]
|
146
153
|
@riddl_opts[:custom_protocol].error_handling(e)
|
@@ -152,6 +159,9 @@ module Riddl
|
|
152
159
|
def parallel(&blk)
|
153
160
|
@riddl_opts[:parallel] = blk
|
154
161
|
end
|
162
|
+
def cleanup(&blk)
|
163
|
+
@riddl_opts[:cleanup] = blk
|
164
|
+
end
|
155
165
|
|
156
166
|
def call(env)# {{{
|
157
167
|
dup.__http_call(env)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
2
2
|
|
3
3
|
<message name="event">
|
4
|
-
<parameter name="
|
4
|
+
<parameter name="key" type="string"/>
|
5
5
|
<parameter name="topic" type="string">
|
6
6
|
<param name="pattern">[\w_/]+</param>
|
7
7
|
</parameter>
|
@@ -12,6 +12,9 @@
|
|
12
12
|
<parameter name="notification" type="string"/>
|
13
13
|
<parameter name="notification" mimetype="application/json"/>
|
14
14
|
</choice>
|
15
|
+
<optional>
|
16
|
+
<parameter name="fingerprint-with-consumer-secret" type="string"/>
|
17
|
+
</optional>
|
15
18
|
</message>
|
16
19
|
|
17
20
|
<message name="vote">
|
data/riddl.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "riddl"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.108"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0"
|
6
6
|
s.summary = "restful interface description and declaration language: tools and client/server libs"
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.required_ruby_version = '>=2.2.0'
|
24
24
|
|
25
|
-
s.add_runtime_dependency 'daemonite', '~>0.
|
25
|
+
s.add_runtime_dependency 'daemonite', '~>0.6', '>=0.6.0'
|
26
26
|
s.add_runtime_dependency 'typhoeus', '~>1.3'
|
27
27
|
s.add_runtime_dependency 'xml-smart', '>=0.4.3', '~>0'
|
28
28
|
s.add_runtime_dependency 'rdf-smart', '>=0.0.160', '~>0'
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riddl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.108'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen 'eTM' Mangler
|
8
8
|
- Florian 'Solo' Stertz
|
9
9
|
- Sonja Biedermann
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: tools
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-10-
|
13
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: daemonite
|
@@ -18,20 +18,20 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
21
|
+
version: '0.6'
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 0.
|
24
|
+
version: 0.6.0
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
29
|
- - "~>"
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: '0.
|
31
|
+
version: '0.6'
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.6.0
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: typhoeus
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -395,7 +395,6 @@ files:
|
|
395
395
|
- examples/pass-test/structure.xml
|
396
396
|
- examples/properties/description.conf
|
397
397
|
- examples/properties/description.rb
|
398
|
-
- examples/properties/properties.schema.xsl
|
399
398
|
- examples/properties/properties.xml
|
400
399
|
- examples/properties/server.properties.schema
|
401
400
|
- examples/properties/server.properties.xml
|
@@ -534,7 +533,7 @@ homepage: http://www.wst.univie.ac.at/communities/riddl/
|
|
534
533
|
licenses:
|
535
534
|
- LGPL-3.0
|
536
535
|
metadata: {}
|
537
|
-
post_install_message:
|
536
|
+
post_install_message:
|
538
537
|
rdoc_options: []
|
539
538
|
require_paths:
|
540
539
|
- lib/ruby
|
@@ -549,8 +548,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
549
548
|
- !ruby/object:Gem::Version
|
550
549
|
version: '0'
|
551
550
|
requirements: []
|
552
|
-
rubygems_version: 3.1.
|
553
|
-
signing_key:
|
551
|
+
rubygems_version: 3.1.4
|
552
|
+
signing_key:
|
554
553
|
specification_version: 4
|
555
554
|
summary: 'restful interface description and declaration language: tools and client/server
|
556
555
|
libs'
|
@@ -1 +0,0 @@
|
|
1
|
-
../../ns/common-patterns/properties/1.0/properties.schema.xsl
|