riddl 0.101.17 → 0.101.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 103e67ac3db9a89d45c0ebaa0ace242a69fcd4da4c9c964d0caaa69497837d87
4
- data.tar.gz: 7c532f031ceea4193a554ede2fb05c3f4923c9f9bc1f12e80aa1984ed50974e9
3
+ metadata.gz: 8b0c69ed74aacd5d1e986311d0d84934c91a66e59224d6d3a0e3971a5397d411
4
+ data.tar.gz: fe9e202e7b2f42d8561e0eb0946254c4d9f9a5a6adf3d1dd1e9fe724968609be
5
5
  SHA512:
6
- metadata.gz: 014ff19c79f656f7ac1fa613aef36973da12a30229ab055ab6d97d2eacbf41e6850b24b381f938f0b5713007fd07f66d4fbafc0f4c3a054c7383bde448ce1d5f
7
- data.tar.gz: 4a8b74408654c019d1fa239a212ffe3c49d9afcae095adb10a8edeb14ce834fcc30913c98756140decd826fe0b1e6cfc6202f38c657295ab7ccf82127da9db0d
6
+ metadata.gz: 5969e8231531f20da2e5df34d3bb46043df109331bcd0ca4533ff4ed02cd0195cc733f89bff56c8525f22dc794a7d806676b8d8de02ab97a6c0cd0f8d0f32758
7
+ data.tar.gz: 10a8c256399af36f642ca6ecfdd3bbc2ad054bb2295999cfde8a9e9602f3eb7d11d57db8cebeb011858e1a5290bf115a29c4fb9547aa008f2fceaf0453dcd105
@@ -2,9 +2,7 @@
2
2
  <description xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <message name="hello">
4
4
  <parameter name="return" mimetype="text/plain" handler="http://riddl.org/ns/handlers/plain-type">
5
- <plain type="string">
6
- <param name="pattern">hello .+</param>
7
- </plain>
5
+ <pattern>hello .+</pattern>
8
6
  </parameter>
9
7
  </message>
10
8
  <message name="hello-form">
@@ -2,9 +2,7 @@
2
2
 
3
3
  <message name="hello">
4
4
  <parameter name="return" mimetype="text/plain" handler="http://riddl.org/ns/handlers/plain-type">
5
- <plain type="string">
6
- <param name="pattern">hello .+</param>
7
- </plain>
5
+ <pattern>hello .+</pattern>
8
6
  </parameter>
9
7
  </message>
10
8
  <message name="hello-form">
@@ -22,15 +20,15 @@
22
20
  <parameter name="type" type="string">
23
21
  <choice>
24
22
  <value>html</value>
25
- </choice>
26
- </parameter>
23
+ </choice>
24
+ </parameter>
27
25
  </message>
28
26
 
29
27
  <resource>
30
28
  <post in="hello"/>
31
29
  <post in="hello-form"/>
32
30
  <get in="*" out="hello-form"/>
33
- <get in="type-html" out="hello-list-html"/>
31
+ <get in="type-html" out="hello-list-html"/>
34
32
  <resource>
35
33
  <get in="*" out="hello"/>
36
34
  <put in="hello" out="hello"/>
@@ -43,5 +41,5 @@
43
41
  <post in="hello"/>
44
42
  </resource>
45
43
  </resource>
46
-
44
+
47
45
  </description>
@@ -4,7 +4,7 @@
4
4
  <!--header name="Library" type="positiveInteger"/-->
5
5
  <oneOrMore>
6
6
  <parameter name="author" type="string"/>
7
- </oneOrMore>
7
+ </oneOrMore>
8
8
  <parameter name="title" type="string"/>
9
9
  </message>
10
10
  <message name="list-of-books">
@@ -13,9 +13,9 @@
13
13
  </parameter>
14
14
  </message>
15
15
  <message name="book-description-form">
16
- <oneOrMore>
16
+ <oneOrMore>
17
17
  <parameter name="author" type="string"/>
18
- </oneOrMore>
18
+ </oneOrMore>
19
19
  <parameter name="title" type="string"/>
20
20
  </message>
21
21
  <message name="book-description">
@@ -25,7 +25,7 @@
25
25
  </message>
26
26
  <message name="book-id">
27
27
  <parameter name="book-id" mimetype="text/plain" handler="http://riddl.org/ns/handlers/plain-type">
28
- <plain type="positiveInteger"/>
28
+ <pattern>\d+</pattern>
29
29
  </parameter>
30
30
  </message>
31
31
 
@@ -75,6 +75,6 @@
75
75
  <resource relative="about">
76
76
  <get in="*" out="main-output"/>
77
77
  </resource>
78
- </resource>
78
+ </resource>
79
79
 
80
80
  </description>
@@ -4,18 +4,19 @@ module Riddl
4
4
  def self::handle(what,hinfo)
5
5
  if what.class == Riddl::Parameter::Tempfile
6
6
  w = what.read
7
- else
7
+ else
8
8
  w = what
9
- end
9
+ end
10
10
  begin
11
- re = Regexp.new(hinfo)
12
- rescue
11
+ hi = XML::Smart::string(hinfo)
12
+ re = Regexp.new(hi.root.text)
13
+ rescue => e
13
14
  return false
14
15
  end
15
16
  w =~ re
16
17
  end
17
18
  end
18
- end
19
- end
19
+ end
20
+ end
20
21
 
21
22
  Riddl::Handlers::add("http://riddl.org/ns/handlers/plain-type",Riddl::Handlers::PlainType)
@@ -40,10 +40,10 @@ module Riddl
40
40
  def onerror(err);end
41
41
 
42
42
  def send(data)
43
- self.io.send_with_id 'data', data
43
+ @ws[:io].send_with_id 'data', data
44
44
  end
45
45
  def send_with_id(id,data)
46
- self.io.send_with_id id, data
46
+ @ws[:io].send_with_id id, data
47
47
  end
48
48
 
49
49
  def io=(connection)
@@ -77,7 +77,7 @@ module Riddl
77
77
  def onerror(err);end
78
78
 
79
79
  def send(data)
80
- self.io.send data
80
+ @ws[:io].send data
81
81
  end
82
82
 
83
83
  def io=(connection)
@@ -0,0 +1,52 @@
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
+
3
+ <message name="event">
4
+ <parameter name="type" fixed="event"/>
5
+ <parameter name="topic" type="string">
6
+ <param name="pattern">[\w_/]+</param>
7
+ </parameter>
8
+ <parameter name="event" type="string">
9
+ <param name="pattern">[\w_]+</param>
10
+ </parameter>
11
+ <choice>
12
+ <parameter name="notification" type="string"/>
13
+ <parameter name="notification" mimetype="application/json"/>
14
+ </choice>
15
+ </message>
16
+
17
+ <message name="vote">
18
+ <parameter name="type" fixed="vote"/>
19
+ <parameter name="topic" type="string">
20
+ <param name="pattern">[\w_/]+</param>
21
+ </parameter>
22
+ <parameter name="vote" type="string">
23
+ <param name="pattern">[\w_]+</param>
24
+ </parameter>
25
+ <parameter name="callback" type="string"/>
26
+ <choice>
27
+ <parameter name="notification" type="string"/>
28
+ <parameter name="notification" mimetype="application/json"/>
29
+ </choice>
30
+ </message>
31
+
32
+ <message name="acknowledgment">
33
+ <choice>
34
+ <parameter name="continue" type="string">
35
+ <choice>
36
+ <value>true</value>
37
+ <value>false</value>
38
+ <value>callback</value>
39
+ </choice>
40
+ </parameter>
41
+ <parameter name="continue" mimetype="text/plain" handler="http://riddl.org/ns/handlers/plain-type">
42
+ <pattern>^(true|false|callback)$</pattern>
43
+ </parameter>
44
+ </choice>
45
+ </message>
46
+
47
+ <resource pattern="http://riddl.org/ns/common-patterns/notifications-consumer/2.0">
48
+ <post in="event"/>
49
+ <post in="vote" out="acknowledgment"/>
50
+ </resource>
51
+
52
+ </description>
@@ -34,9 +34,16 @@ module Riddl
34
34
  body = ''
35
35
  end
36
36
 
37
- if content_length == 0 && name == ''
37
+ if content_length == 0
38
+ bufsize = 16384
39
+ until input.eof?
40
+ c = input.read(bufsize)
41
+ raise EOFError, "bad content body" if c.nil? || c.empty?
42
+ body << c
43
+ content_length -= c.size
44
+ end
38
45
  body << input.read
39
- else
46
+ else
40
47
  bufsize = 16384
41
48
  until content_length <= 0
42
49
  c = input.read(bufsize < content_length ? bufsize : content_length)
@@ -131,7 +138,7 @@ module Riddl
131
138
  @params << Parameter::Complex.new(name, ctype, body, filename, head)
132
139
  elsif !filename && ctype
133
140
  body.rewind
134
-
141
+
135
142
  # Generic multipart cases, not coming from a form
136
143
  @params << Parameter::Complex.new(name, ctype, body, nil, head)
137
144
  else
@@ -170,7 +177,7 @@ module Riddl
170
177
  elsif FORM_CONTENT_TYPES.include?(media_type)
171
178
  # sub is a fix for Safari Ajax postings that always append \0
172
179
  parse_nested_query(input.read.sub(/\0\z/, ''),:body)
173
- else
180
+ else
174
181
  parse_content(input,content_type,content_length.to_i,content_disposition||'',content_id||'',riddl_type||'')
175
182
  end
176
183
 
@@ -187,4 +194,4 @@ module Riddl
187
194
  end
188
195
  end
189
196
  end
190
- end
197
+ end
@@ -162,7 +162,7 @@ module Riddl
162
162
  if @riddl_message.nil?
163
163
  if @riddl_info[:env].has_key?('HTTP_ORIGIN') && @riddl_cross_site_xhr && @riddl_method == 'options'
164
164
  @riddl_res['Access-Control-Allow-Origin'] = '*'
165
- @riddl_res['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'
165
+ @riddl_res['Access-Control-Allow-Methods'] = 'GET, POST, PUT, PATCH, DELETE, OPTIONS'
166
166
  @riddl_res['Access-Control-Allow-Headers'] = @riddl_info[:env]['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'] if @riddl_info[:env]['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']
167
167
  @riddl_res['Access-Control-Max-Age'] = '0'
168
168
  @riddl_res['Content-Length'] = '0'
@@ -223,7 +223,7 @@ module Riddl
223
223
  @riddl_res = Rack::Response.new
224
224
  @riddl_status = 404
225
225
 
226
- @riddl_pinfo = Riddl::Protocols::Utils::unescape(@riddl_env["PATH_INFO"].gsub(/\/+/,'/'))
226
+ @riddl_pinfo = @riddl_env["PATH_INFO"].gsub(/\/+/,'/')
227
227
  @riddl_matching_path = @riddl_paths.find{ |e| @riddl_pinfo.match(e[1]).to_s.length == @riddl_pinfo.length }
228
228
 
229
229
  if @riddl_matching_path
@@ -466,7 +466,7 @@ module Riddl
466
466
  nodes.each do |ele|
467
467
  if value.nil?
468
468
  newstuff.each do |child|
469
- cpath = File.basename(child.path)
469
+ cpath = File.basename(child.qname.name)
470
470
  subele = ele.find("p:" + cpath).first
471
471
  if subele
472
472
  subele.replace_by_copy(child)
@@ -79,7 +79,7 @@ module Riddl
79
79
  name = File.expand_path(File.dirname(__FILE__)) + $2
80
80
  end
81
81
  begin
82
- fh = name.respond_to?(:read) ? name : open(name,:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)
82
+ fh = name.respond_to?(:read) ? name : URI.open(name,:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)
83
83
  @doc = XML::Smart.string(fh.read)
84
84
  fh.close
85
85
  fpath = File.dirname(fh.path) if fh.is_a?(File) || fh.is_a?(Tempfile)
@@ -26,6 +26,7 @@ module Riddl
26
26
 
27
27
  # out not available
28
28
  return true if what.nil? && @mist.empty?
29
+ return false if what.nil?
29
30
 
30
31
  # do it
31
32
  m = what.content.root
@@ -0,0 +1,52 @@
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
+
3
+ <message name="event">
4
+ <parameter name="type" fixed="event"/>
5
+ <parameter name="topic" type="string">
6
+ <param name="pattern">[\w_/]+</param>
7
+ </parameter>
8
+ <parameter name="event" type="string">
9
+ <param name="pattern">[\w_]+</param>
10
+ </parameter>
11
+ <choice>
12
+ <parameter name="notification" type="string"/>
13
+ <parameter name="notification" mimetype="application/json"/>
14
+ </choice>
15
+ </message>
16
+
17
+ <message name="vote">
18
+ <parameter name="type" fixed="vote"/>
19
+ <parameter name="topic" type="string">
20
+ <param name="pattern">[\w_/]+</param>
21
+ </parameter>
22
+ <parameter name="vote" type="string">
23
+ <param name="pattern">[\w_]+</param>
24
+ </parameter>
25
+ <parameter name="callback" type="string"/>
26
+ <choice>
27
+ <parameter name="notification" type="string"/>
28
+ <parameter name="notification" mimetype="application/json"/>
29
+ </choice>
30
+ </message>
31
+
32
+ <message name="acknowledgment">
33
+ <choice>
34
+ <parameter name="continue" type="string">
35
+ <choice>
36
+ <value>true</value>
37
+ <value>false</value>
38
+ <value>callback</value>
39
+ </choice>
40
+ </parameter>
41
+ <parameter name="continue" mimetype="text/plain" handler="http://riddl.org/ns/handlers/plain-type">
42
+ <pattern>^(true|false|callback)$</pattern>
43
+ </parameter>
44
+ </choice>
45
+ </message>
46
+
47
+ <resource pattern="http://riddl.org/ns/common-patterns/notifications-consumer/2.0">
48
+ <post in="event"/>
49
+ <post in="vote" out="acknowledgment"/>
50
+ </resource>
51
+
52
+ </description>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.101.17"
3
+ s.version = "0.101.26"
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"
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
15
15
  s.executables = ['riddlcheck','riddlprocess']
16
16
  s.test_files = Dir['test/tc_*.rb','test/smartrunner.rb']
17
17
 
18
-
19
18
  s.email = 'juergen.mangler@gmail.com'
20
19
  s.authors = ['Juergen \'eTM\' Mangler','Florian \'Solo\' Stertz','Sonja Biedermann']
21
20
  s.email = 'juergen.mangler@gmail.com'
@@ -23,7 +22,7 @@ Gem::Specification.new do |s|
23
22
 
24
23
  s.required_ruby_version = '>=2.2.0'
25
24
 
26
- s.add_runtime_dependency 'daemonite', '~>0.2'
25
+ s.add_runtime_dependency 'daemonite', '~>0.5', '>=0.5.9'
27
26
  s.add_runtime_dependency 'typhoeus', '~>1.3'
28
27
  s.add_runtime_dependency 'xml-smart', '>=0.4.3', '~>0'
29
28
  s.add_runtime_dependency 'rdf-smart', '>=0.0.160', '~>0'
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.101.17
4
+ version: 0.101.26
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-08-04 00:00:00.000000000 Z
13
+ date: 2020-10-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite
@@ -18,14 +18,20 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '0.2'
21
+ version: '0.5'
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 0.5.9
22
25
  type: :runtime
23
26
  prerelease: false
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
29
  - - "~>"
27
30
  - !ruby/object:Gem::Version
28
- version: '0.2'
31
+ version: '0.5'
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.5.9
29
35
  - !ruby/object:Gem::Dependency
30
36
  name: typhoeus
31
37
  requirement: !ruby/object:Gem::Requirement
@@ -441,6 +447,7 @@ files:
441
447
  - lib/ruby/riddl/ns/common-patterns/addon-security/response.xml
442
448
  - lib/ruby/riddl/ns/common-patterns/downloadify/1.0/downloadify.xml
443
449
  - lib/ruby/riddl/ns/common-patterns/notifications-consumer/1.0/consumer.xml
450
+ - lib/ruby/riddl/ns/common-patterns/notifications-consumer/2.0/consumer.xml
444
451
  - lib/ruby/riddl/ns/common-patterns/notifications-producer/1.0/producer.xml
445
452
  - lib/ruby/riddl/ns/common-patterns/notifications-producer/2.0/producer.xml
446
453
  - lib/ruby/riddl/ns/common-patterns/oauth2-univie-app/1.0/app.xml
@@ -501,6 +508,7 @@ files:
501
508
  - ns/common-patterns/addon-security/response.xml
502
509
  - ns/common-patterns/downloadify/1.0/downloadify.xml
503
510
  - ns/common-patterns/notifications-consumer/1.0/consumer.xml
511
+ - ns/common-patterns/notifications-consumer/2.0/consumer.xml
504
512
  - ns/common-patterns/notifications-producer/1.0/producer.xml
505
513
  - ns/common-patterns/notifications-producer/2.0/producer.xml
506
514
  - ns/common-patterns/oauth2-univie-app/1.0/app.xml