riddl 0.100.0 → 0.100.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6c102b4a4f29887b96b6a662b8360be51afe2e50
4
- data.tar.gz: 5d7849b43316dc94506af325f1c00a35822dbd61
2
+ SHA256:
3
+ metadata.gz: 7bbf147d1c3cdf7fabaa45f46736231fbf8fc9eaf22b7991e69286c285c0f0de
4
+ data.tar.gz: 624c1268283341b12b133be1837b43e64f40e7f3ab24df078d404bd30b7c3ff8
5
5
  SHA512:
6
- metadata.gz: e68ae727140620b7222d3bb4d4f117e4d73d78bc15cd69e2df93359c0940b2c69bffff26d54a791f0f1b9c8b8f26a0e76fd4f0b3cc0976f7ffe9d366c04c251f
7
- data.tar.gz: e670b312fe3a8990ded62151f15caa1674b20201eef3d652d73d6d181d59fa014179d6bf456e2be89be454d64c900eba13caf1dd2a7bdd6fe2e384a1d29d8b0d
6
+ metadata.gz: 363535976cbd4c00ef577419d9bed524df4fbb7d007e0ba62e72d3bb376a8b4a5a1924092fd351d9f31af95d223c94254f09c5eb17823e245818a791346f2816
7
+ data.tar.gz: 8328ca1ad78e374c324849d29ee20778c828f275306c117e1c60a6c959608917187e887fde4876c39925e5777caeca43f825723f040863ac5922f354172f94ed
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/ruby
2
+ require 'pp'
3
+ require 'memory_profiler'
4
+ require File.expand_path(File.join(__dir__,'..','..','lib','ruby','riddl','server'))
5
+
6
+ class Hello < Riddl::Implementation
7
+ def response
8
+ Riddl::Parameter::Complex.new("hello","text/plain","Hello World")
9
+ end
10
+ end
11
+
12
+ Riddl::Server.new(__dir__ + '/simple.xml', :port => 9292) do
13
+ accessible_description true
14
+
15
+ on resource do
16
+ MemoryProfiler.start
17
+ run Hello if get
18
+ report = MemoryProfiler.stop
19
+ puts report.pretty_print
20
+ end
21
+ end.loop!
@@ -0,0 +1,11 @@
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="hello">
4
+ <parameter name="return" mimetype="text/plain"/>
5
+ </message>
6
+
7
+ <resource>
8
+ <get in="*" out="hello"/>
9
+ </resource>
10
+
11
+ </description>
@@ -61,7 +61,8 @@ module Riddl
61
61
  ],
62
62
  :runtime_cmds => [],
63
63
  :runtime_proc => Proc.new { |opts|
64
- @riddl_opts[:cmdl_info] = @riddl_opts[:url] = (@riddl_opts[:secure] ? 'https://' : 'http://') + @riddl_opts[:host] + ':' + @riddl_opts[:port].to_s
64
+ @riddl_opts[:cmdl_info] = (@riddl_opts[:secure] ? 'https://' : 'http://') + @riddl_opts[:host] + ':' + @riddl_opts[:port].to_s
65
+ @riddl_opts[:url] ||= @riddl_opts[:cmdl_info]
65
66
  }
66
67
  }).merge(opts)
67
68
 
@@ -138,7 +139,7 @@ module Riddl
138
139
  if @riddl_opts[:custom_protocol] && !@riddl_opts[:http_only]
139
140
  @riddl_opts[:custom_protocol].error_handling(e)
140
141
  end
141
- puts "Server (#{@riddl_opts[:url]}) stopped due to connection error (PID:#{Process.pid})"
142
+ puts "Server (#{@riddl_opts[:cmdl_info]}) stopped due to connection error (PID:#{Process.pid})"
142
143
  end
143
144
  end #}}}
144
145
 
data/riddl.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.100.0"
3
+ s.version = "0.100.1"
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"
@@ -35,5 +35,5 @@ Gem::Specification.new do |s|
35
35
  s.add_runtime_dependency 'mime-types', '>= 2.4', '~>2'
36
36
  s.add_runtime_dependency 'minitest', '>= 5.0.0', '~>5'
37
37
  s.add_runtime_dependency 'charlock_holmes', '>= 0.7', '~>0'
38
- s.add_runtime_dependency 'redis', '>= 3.3.0', '~>3.3'
38
+ s.add_runtime_dependency 'redis', '>= 4.0', '~>4.0'
39
39
  end
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.100.0
4
+ version: 0.100.1
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: 2018-04-24 00:00:00.000000000 Z
13
+ date: 2018-07-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite
@@ -234,20 +234,20 @@ dependencies:
234
234
  requirements:
235
235
  - - ">="
236
236
  - !ruby/object:Gem::Version
237
- version: 3.3.0
237
+ version: '4.0'
238
238
  - - "~>"
239
239
  - !ruby/object:Gem::Version
240
- version: '3.3'
240
+ version: '4.0'
241
241
  type: :runtime
242
242
  prerelease: false
243
243
  version_requirements: !ruby/object:Gem::Requirement
244
244
  requirements:
245
245
  - - ">="
246
246
  - !ruby/object:Gem::Version
247
- version: 3.3.0
247
+ version: '4.0'
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '3.3'
250
+ version: '4.0'
251
251
  description: rest service interface definition, mixing, and evolution. supports mixed
252
252
  http and xmpp servers.
253
253
  email: juergen.mangler@gmail.com
@@ -285,7 +285,6 @@ files:
285
285
  - examples/declaration-server-distributed/properties.xml
286
286
  - examples/declaration-server-distributed/rngs/instance-info.rng
287
287
  - examples/declaration-server-distributed/rngs/instances.rng
288
- - examples/declaration-server-distributed/test.xml
289
288
  - examples/declaration-server-distributed/xsloverlay.rb
290
289
  - examples/declaration-server-distributed/xsloverlay.xml
291
290
  - examples/declaration-server-distributed/xsls/info.xsl
@@ -325,7 +324,6 @@ files:
325
324
  - examples/declaration-test/declaration2.xml
326
325
  - examples/declaration-test/goal/goal.txt
327
326
  - examples/declaration-test/goal/goal.xml
328
- - examples/declaration-test/main.log
329
327
  - examples/declaration-test/main.rb
330
328
  - examples/declaration-test/main.xml
331
329
  - examples/declaration-test/over.xml
@@ -349,7 +347,6 @@ files:
349
347
  - examples/flickr/Exif/exif.test
350
348
  - examples/flickr/Exif/exif.xml
351
349
  - examples/flickr/Exif/riddl.jpg
352
- - examples/flickr/Exif/riddl.new.jpg
353
350
  - examples/flickr/Flickr/authenticate.rb
354
351
  - examples/flickr/Flickr/find.rb
355
352
  - examples/flickr/Flickr/flickr.rb
@@ -398,6 +395,8 @@ files:
398
395
  - examples/properties/properties.xml
399
396
  - examples/properties/server.properties.schema
400
397
  - examples/properties/server.properties.xml
398
+ - examples/simple/server.rb
399
+ - examples/simple/simple.xml
401
400
  - examples/twitter/README
402
401
  - examples/twitter/client.rb
403
402
  - examples/twitter/declaration.xml
@@ -407,11 +406,6 @@ files:
407
406
  - examples/websocket/description.xml
408
407
  - examples/websocket/sample.html
409
408
  - examples/websocket/server.rb
410
- - examples/xmpp/blather/description.xml
411
- - examples/xmpp/blather/direct.rb
412
- - examples/xmpp/blather/load.rb
413
- - examples/xmpp/blather/pp.rb
414
- - examples/xmpp/blather/test.rb
415
409
  - examples/xmpp/client.rb
416
410
  - examples/xmpp/description.rb
417
411
  - examples/xmpp/properties.xml
@@ -419,7 +413,6 @@ files:
419
413
  - examples/xmpp/server.properties.xml
420
414
  - examples/zotero/README
421
415
  - examples/zotero/client.rb
422
- - examples/zotero/litlist.html
423
416
  - examples/zotero/zotero.xml
424
417
  - lib/ruby/riddl/client.rb
425
418
  - lib/ruby/riddl/commonlogger.rb
@@ -544,18 +537,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
544
537
  version: '0'
545
538
  requirements: []
546
539
  rubyforge_project:
547
- rubygems_version: 2.6.6
540
+ rubygems_version: 2.7.6
548
541
  signing_key:
549
542
  specification_version: 4
550
543
  summary: 'restful interface description and declaration language: tools and client/server
551
544
  libs'
552
545
  test_files:
553
- - test/tc_properties.rb
554
- - test/tc_declaration-hybrid.rb
555
- - test/tc_declaration-local.rb
556
546
  - test/tc_helloworld.rb
557
- - test/tc_library.rb
558
547
  - test/tc_declaration-distributed.rb
559
- - test/tc_websocket.rb
548
+ - test/tc_declaration-local.rb
560
549
  - test/tc_producer.rb
550
+ - test/tc_properties.rb
551
+ - test/tc_websocket.rb
552
+ - test/tc_declaration-hybrid.rb
553
+ - test/tc_library.rb
561
554
  - test/smartrunner.rb
@@ -1,138 +0,0 @@
1
- <?xml version="1.0"?>
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
- <message name="addxsl">
4
- <parameter name="xml" mimetype="*/xml"/>
5
- </message>
6
- <message name="query">
7
- <parameter name="query" type="string"/>
8
- </message>
9
- <message name="resource-document-schema">
10
- <parameter name="document-schema" mimetype="text/xml"/>
11
- </message>
12
- <message name="property">
13
- <parameter name="name" type="string">
14
- <param name="pattern">[a-zA-Z_][a-zA-Z0-9_]*</param>
15
- </parameter>
16
- <choice>
17
- <parameter name="value" type="string"/>
18
- <parameter name="value" mimetype="text/plain"/>
19
- <parameter name="content" mimetype="text/xml"/>
20
- <!-- add everything inside the root tag -->
21
- <parameter name="content" type="string"/>
22
- <!-- add everything inside the root tag -->
23
- </choice>
24
- </message>
25
- <message name="properties">
26
- <oneOrMore>
27
- <parameter name="name" type="string"/>
28
- <choice>
29
- <parameter name="value" type="string"/>
30
- <parameter name="value" mimetype="text/plain"/>
31
- <parameter name="content" mimetype="text/xml"/>
32
- <!-- add everything inside the root tag -->
33
- <parameter name="content" type="string"/>
34
- <!-- add everything inside the root tag -->
35
- </choice>
36
- </oneOrMore>
37
- </message>
38
- <message name="addcontent">
39
- <choice>
40
- <parameter name="value" type="string"/>
41
- <parameter name="value" mimetype="text/xml"/>
42
- </choice>
43
- </message>
44
- <message name="updcontent">
45
- <choice>
46
- <parameter name="value" type="string"/>
47
- <parameter name="value" mimetype="text/plain"/>
48
- <parameter name="content" mimetype="text/xml"/>
49
- <!-- add everything inside the root tag -->
50
- <parameter name="content" type="string"/>
51
- <!-- add everything inside the root tag -->
52
- </choice>
53
- </message>
54
- <message name="value">
55
- <choice>
56
- <parameter name="value" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
57
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://riddl.org/ns/common-patterns/properties/1.0">
58
- <start>
59
- <choice>
60
- <element name="value">
61
- <ref name="value"/>
62
- </element>
63
- <element name="not-existing">
64
- <empty/>
65
- </element>
66
- </choice>
67
- </start>
68
- <define name="value">
69
- <zeroOrMore>
70
- <choice>
71
- <text/>
72
- <ref name="any"/>
73
- </choice>
74
- </zeroOrMore>
75
- </define>
76
- <define name="any">
77
- <element>
78
- <anyName/>
79
- <zeroOrMore>
80
- <attribute>
81
- <anyName/>
82
- </attribute>
83
- </zeroOrMore>
84
- <ref name="value"/>
85
- </element>
86
- </define>
87
- </grammar>
88
- </parameter>
89
- <parameter name="value" type="string"/>
90
- <parameter name="content" mimetype="text/xml"/>
91
- <parameter name="content" mimetype="text/plain"/>
92
- </choice>
93
- </message>
94
- <resource>
95
- <get in="*" out="addxsl"/>
96
- <resource>
97
- <get in="*" out="addxsl"/>
98
- <delete in="*"/>
99
- <resource relative="properties">
100
- <get in="query" out="addxsl"/>
101
- <get in="*" out="addxsl"/>
102
- <resource relative="schema">
103
- <get in="*" out="resource-document-schema"/>
104
- <resource relative="rng">
105
- <get in="*" out="resource-document-schema"/>
106
- </resource>
107
- <resource relative="xsd">
108
- <get in="*" out="resource-document-schema"/>
109
- </resource>
110
- </resource>
111
- <resource relative="values">
112
- <post in="property"/>
113
- <put in="properties"/>
114
- <get in="*" out="addxsl"/>
115
- <resource>
116
- <post in="addcontent"/>
117
- <put in="updcontent"/>
118
- <get in="*" out="value"/>
119
- <delete in="*"/>
120
- <resource>
121
- <put in="updcontent"/>
122
- <get in="*" out="value"/>
123
- <delete in="*"/>
124
- <resource recursive="true">
125
- <get in="*" out="value"/>
126
- </resource>
127
- </resource>
128
- </resource>
129
- </resource>
130
- </resource>
131
- </resource>
132
- <resource relative="xsls">
133
- <resource recursive="true">
134
- <get in="*" out="addxsl"/>
135
- </resource>
136
- </resource>
137
- </resource>
138
- </description>
@@ -1,57 +0,0 @@
1
- # Logfile created on 2013-05-21 22:59:18 +0200 by logger.rb/31641
2
- Main: 127.0.0.1 - - [21/May/2013 23:04:19] "GET / HTTP/1.1" 200 - 0.0376
3
- Main: 127.0.0.1 - - [21/May/2013 23:04:19] "GET /favicon.ico HTTP/1.1" 404 - 0.0001
4
- Main: 127.0.0.1 - - [21/May/2013 23:04:19] "GET /favicon.ico HTTP/1.1" 404 - 0.0001
5
- Main: 127.0.0.1 - - [21/May/2013 23:04:45] "GET /?a=1 HTTP/1.1" 200 - 0.0321
6
- Main: 127.0.0.1 - - [21/May/2013 23:04:49] "GET /?b=1 HTTP/1.1" 200 - 0.0056
7
- Main: 127.0.0.1 - - [21/May/2013 23:04:52] "GET /?b=2 HTTP/1.1" 200 - 0.0055
8
- Main: 127.0.0.1 - - [21/May/2013 23:04:57] "GET /?c=2 HTTP/1.1" 200 - 0.0056
9
- Main: 127.0.0.1 - - [21/May/2013 23:05:00] "GET /?d=2 HTTP/1.1" 200 - 0.0053
10
- Main: 127.0.0.1 - - [21/May/2013 23:05:08] "GET /?e=2 HTTP/1.1" 200 - 0.0052
11
- Main: 127.0.0.1 - - [21/May/2013 23:07:26] "GET /?a=2 HTTP/1.1" 200 - 0.0510
12
- Main: 127.0.0.1 - - [21/May/2013 23:08:22] "GET /?a=2 HTTP/1.1" 200 - 0.0334
13
- Main: 127.0.0.1 - - [21/May/2013 23:08:50] "GET /?a=2 HTTP/1.1" 200 - 0.0322
14
- Main: 127.0.0.1 - - [21/May/2013 23:09:14] "GET /?a=2 HTTP/1.1" 200 - 0.0324
15
- Main: 127.0.0.1 - - [21/May/2013 23:09:49] "GET /?a=2 HTTP/1.1" 200 - 0.0321
16
- Main: 127.0.0.1 - - [21/May/2013 23:48:23] "GET /?a=2 HTTP/1.1" 200 - 0.0485
17
- Main: 127.0.0.1 - - [21/May/2013 23:51:30] "GET /?a=2 HTTP/1.1" 200 - 0.0326
18
- Main: 127.0.0.1 - - [21/May/2013 23:52:03] "GET /?a=2 HTTP/1.1" 200 - 0.0311
19
- Main: 127.0.0.1 - - [21/May/2013 23:53:37] "GET /?a=2 HTTP/1.1" 200 - 0.0337
20
- Main: 127.0.0.1 - - [21/May/2013 23:55:32] "GET /?a=2 HTTP/1.1" 200 - 0.0316
21
- 127.0.0.1 - - [21/May/2013 23:55:32] "GET /?a=2 HTTP/1.1" 200 1 0.0321
22
- Main: 127.0.0.1 - - [21/May/2013 23:55:49] "GET /?a=2 HTTP/1.1" 200 - 0.0324
23
- Main: 127.0.0.1 - - [21/May/2013 23:59:45] "GET /?a=2 HTTP/1.1" 200 - 0.0114
24
- Main: 127.0.0.1 - - [22/May/2013 00:00:23] "GET /?a=2 HTTP/1.1" 200 - 0.0114
25
- Main: 127.0.0.1 - - [22/May/2013 00:00:31] "GET /?a=2 HTTP/1.1" 200 - 0.0074
26
- Main: 127.0.0.1 - - [22/May/2013 00:01:13] "GET /?a=2 HTTP/1.1" 200 - 0.0316
27
- Main: 127.0.0.1 - - [22/May/2013 00:02:24] "GET /?a=2 HTTP/1.1" 200 - 0.0114
28
- Main: 127.0.0.1 - - [22/May/2013 00:02:59] "GET /?a=2 HTTP/1.1" 200 - 0.0156
29
- Main: 127.0.0.1 - - [22/May/2013 00:14:10] "GET /?a=2 HTTP/1.1" 200 - 0.0112
30
- Main: 127.0.0.1 - - [22/May/2013 00:14:11] "GET /?a=2 HTTP/1.1" 200 - 0.0062
31
- Main: 127.0.0.1 - - [22/May/2013 00:18:11] "GET /?a=2 HTTP/1.1" 200 - 0.0115
32
- Main: 127.0.0.1 - - [22/May/2013 00:18:14] "GET /?a=2 HTTP/1.1" 200 - 0.0054
33
- Main: 127.0.0.1 - - [22/May/2013 00:19:07] "GET /?a=2 HTTP/1.1" 200 - 0.0368
34
- Main: 127.0.0.1 - - [22/May/2013 00:19:31] "GET /?a=2 HTTP/1.1" 200 - 0.0321
35
- Main: 127.0.0.1 - - [22/May/2013 00:19:34] "GET /?a=2 HTTP/1.1" 200 - 0.0104
36
- Main: 127.0.0.1 - - [22/May/2013 00:20:01] "GET /?a=2 HTTP/1.1" 200 - 0.0323
37
- Main: 127.0.0.1 - - [22/May/2013 00:20:01] "GET /?a=2 HTTP/1.1" 200 - 0.0094
38
- Main: 127.0.0.1 - - [22/May/2013 00:20:01] "GET /?a=2 HTTP/1.1" 200 - 0.0051
39
- Main: 127.0.0.1 - - [22/May/2013 00:21:14] "GET /?a=2 HTTP/1.1" 200 - 0.0485
40
- Main: 127.0.0.1 - - [22/May/2013 00:21:15] "GET /?a=2 HTTP/1.1" 200 - 0.0064
41
- Main: 127.0.0.1 - - [22/May/2013 00:21:15] "GET /?a=2 HTTP/1.1" 200 - 0.0094
42
- Main: 127.0.0.1 - - [22/May/2013 00:22:12] "GET /?a=2 HTTP/1.1" 200 - 0.0327
43
- Main: 127.0.0.1 - - [22/May/2013 00:22:36] "GET /?a=2 HTTP/1.1" 200 - 0.0316
44
- Main: 127.0.0.1 - - [22/May/2013 00:22:53] "GET /?a=2 HTTP/1.1" 200 - 0.0480
45
- 127.0.0.1 - - [22/May/2013 00:22:53] "GET /?a=2 HTTP/1.1" 200 1 0.0488
46
- Main::: 127.0.0.1 - - [22/May/2013 00:26:52] "GET /?a=2 HTTP/1.1" 200 1 0.0332
47
- Main::: 127.0.0.1 - - [22/May/2013 00:27:16] "GET / HTTP/1.1" 200 - 0.0326
48
- Main::: 127.0.0.1 - - [22/May/2013 00:27:21] "GET / HTTP/1.1" 200 - 0.0054
49
- Main::: 127.0.0.1 - - [22/May/2013 00:28:05] "GET /?a=1&b=2 HTTP/1.1" 200 7 0.0396
50
- Main::: 127.0.0.1 - - [22/May/2013 00:28:35] "GET /?a=1&b=2 HTTP/1.1" 501 - 0.0334
51
- Main::: 501: the get parameters are not matching anything in the description.Main::: 127.0.0.1 - - [22/May/2013 00:31:19] "GET /?a=1&b=2 HTTP/1.1" 501 - 0.0347
52
- Main::: 501: the get parameters are not matching anything in the description.
53
- Main::: 127.0.0.1 - - [22/May/2013 00:32:10] "GET /?a=1&b=2 HTTP/1.1" 501 - 0.0321
54
- Main::: 501: the get parameters are not matching anything in the description.
55
- Main::: 127.0.0.1 - - [22/May/2013 00:37:50] "GET /?a=1&b=2 HTTP/1.1" 501 - 0.0328
56
- Main: 127.0.0.1 - - [22/May/2013 00:38:45] "GET /?a=1&b=2 HTTP/1.1" 200 7 0.0331
57
- Main: 127.0.0.1 - - [22/May/2013 00:38:49] "GET /?a=1 HTTP/1.1" 200 1 0.0067
Binary file