riddl 0.107 → 0.112
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/sse/server.rb +2 -0
- data/examples/twitter/timeline.rb +76 -0
- data/examples/twitter/twitter.xml +2 -2
- data/examples/zotero/client.rb +10 -7
- data/examples/zotero/litlist.html +511 -202
- data/lib/ruby/riddl/ns/common-patterns/notifications-consumer/2.0/consumer.xml +1 -4
- data/lib/ruby/riddl/protocols/sse.rb +7 -3
- data/lib/ruby/riddl/server.rb +1 -1
- data/lib/ruby/riddl/wrapper/messageparser.rb +4 -2
- data/ns/common-patterns/notifications-consumer/2.0/consumer.xml +1 -4
- data/riddl.gemspec +1 -1
- metadata +3 -2
@@ -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="type" fixed="event"/>
|
5
5
|
<parameter name="topic" type="string">
|
6
6
|
<param name="pattern">[\w_/]+</param>
|
7
7
|
</parameter>
|
@@ -12,9 +12,6 @@
|
|
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>
|
18
15
|
</message>
|
19
16
|
|
20
17
|
<message name="vote">
|
@@ -33,7 +33,7 @@ module Riddl
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def trigger_on_open(); @closed = false; @app.onopen;
|
36
|
+
def trigger_on_open(); @closed = false; res = @app.onopen; res ? true : false; end
|
37
37
|
def trigger_on_close; @closed = true; @app.onclose; end
|
38
38
|
|
39
39
|
def initialize(app, env)
|
@@ -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
@@ -233,7 +233,7 @@ module Riddl
|
|
233
233
|
@riddl_res = Rack::Response.new
|
234
234
|
@riddl_status = 404
|
235
235
|
|
236
|
-
@riddl_pinfo = @riddl_env["PATH_INFO"].gsub(/\/+/,'/')
|
236
|
+
@riddl_pinfo = Riddl::Protocols::Utils::unescape(@riddl_env["PATH_INFO"].gsub(/\/+/,'/'))
|
237
237
|
@riddl_matching_path = @riddl_paths.find{ |e| @riddl_pinfo.match(e[1]).to_s.length == @riddl_pinfo.length }
|
238
238
|
|
239
239
|
if @riddl_matching_path
|
@@ -55,9 +55,11 @@ module Riddl
|
|
55
55
|
|
56
56
|
if b.class == Riddl::Parameter::Simple && (a.attributes['fixed'] || a.attributes['type'])
|
57
57
|
b.name = a.attributes['name'] if @numparams == 1
|
58
|
-
if (b.name == a.attributes['name'] || a.attributes['name'] == '*')
|
58
|
+
if (b.name == a.attributes['name'] || a.attributes['name'] == '*') && match_simple(a,b.value)
|
59
59
|
@mistp += 1
|
60
|
-
return
|
60
|
+
return true
|
61
|
+
else
|
62
|
+
return false
|
61
63
|
end
|
62
64
|
end
|
63
65
|
if b.class == Riddl::Parameter::Complex && a.attributes['mimetype']
|
@@ -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="type" fixed="event"/>
|
5
5
|
<parameter name="topic" type="string">
|
6
6
|
<param name="pattern">[\w_/]+</param>
|
7
7
|
</parameter>
|
@@ -12,9 +12,6 @@
|
|
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>
|
18
15
|
</message>
|
19
16
|
|
20
17
|
<message name="vote">
|
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.
|
4
|
+
version: '0.112'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen 'eTM' Mangler
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: tools
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: daemonite
|
@@ -411,6 +411,7 @@ files:
|
|
411
411
|
- examples/twitter/README
|
412
412
|
- examples/twitter/client.rb
|
413
413
|
- examples/twitter/declaration.xml
|
414
|
+
- examples/twitter/timeline.rb
|
414
415
|
- examples/twitter/twitpic.xml
|
415
416
|
- examples/twitter/twitter.xml
|
416
417
|
- examples/websocket/client.rb
|