riddl 0.107 → 0.112

Sign up to get free protection for your applications and to get access to all the features.
@@ -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="key" type="string"/>
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; end
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
- @env['async.callback'].call [200, headers, @body]
60
- trigger_on_open
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
 
@@ -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 match_simple(a,b.value)
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="key" type="string"/>
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.107"
3
+ s.version = "0.112"
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"
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.107'
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: 2020-10-22 00:00:00.000000000 Z
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