riddl 0.112 → 0.113

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
2
  SHA256:
3
- metadata.gz: 15d7463d1e607ba87b699d916ddcf25ece52a6e9ca19be153a637748da1c9e87
4
- data.tar.gz: 455f950f53982fb012bb6d7f0fb11afb66d032f7a9b71233c8c40fd565ecc8a8
3
+ metadata.gz: 699493c759c420f9708c290b5ceb389b991845691227964a93b8c446c9b74041
4
+ data.tar.gz: fce44440a2750a3c6d60b459c0599815d75c04af980dc426bb2426382eaac7eb
5
5
  SHA512:
6
- metadata.gz: 57ce500bdd4a305f8d459f2454ba1b5711c96ead5496ee3960ccf341e1328f145249df5652c8875d4d89dcce35f32c76af8ed38a998f3b9c41ec34760239a979
7
- data.tar.gz: 8a4e78b08f3fcc79fbfc6ce27233434a769ce341818546fd0eb9c7181101db7820b8da80abe6f299edd11880f5d24a65316951373fff135b1adbf332b5fe4161
6
+ metadata.gz: 9e26099fe2a874cd534cf36cf4dba45b982f49bb97dc65849488f01ba25883850b419f799833081b1557bebf0396dbc2d84b7faf9080afa58fd49e4c5898a719
7
+ data.tar.gz: 7859746d3bdffc03741442a4b00ea3dcc516d4d7b5b205b1d98fe90fc3563ca309e040b5f5ac9f4b252405f1a56a226fff69b4c7715b355268b00ef198e511d5
@@ -96,7 +96,26 @@
96
96
  </parameter>
97
97
  </message>
98
98
 
99
- <message name="subscribe">
99
+ <message name="create_subscription">
100
+ <optional>
101
+ <parameter name="id" type="string"/>
102
+ </optional>
103
+ <optional>
104
+ <parameter name="url" type="string"/>
105
+ </optional>
106
+ <oneOrMore>
107
+ <parameter name="topic" type="string"/>
108
+ <choice>
109
+ <parameter name="votes" type="string">
110
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
111
+ </parameter>
112
+ <parameter name="events" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ </choice>
116
+ </oneOrMore>
117
+ </message>
118
+ <message name="change_subscription">
100
119
  <optional>
101
120
  <parameter name="url" type="string"/>
102
121
  </optional>
@@ -141,10 +160,10 @@
141
160
  </resource>
142
161
  <resource relative="subscriptions">
143
162
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
163
+ <post in="create_subscription" out="acknowledgment"/>
145
164
  <resource>
146
165
  <get out="subscription"/>
147
- <put in="subscribe"/>
166
+ <put in="change_subscription"/>
148
167
  <delete/>
149
168
  <resource relative="sse">
150
169
  <sse/>
@@ -96,7 +96,26 @@
96
96
  </parameter>
97
97
  </message>
98
98
 
99
- <message name="subscribe">
99
+ <message name="create_subscription">
100
+ <optional>
101
+ <parameter name="id" type="string"/>
102
+ </optional>
103
+ <optional>
104
+ <parameter name="url" type="string"/>
105
+ </optional>
106
+ <oneOrMore>
107
+ <parameter name="topic" type="string"/>
108
+ <choice>
109
+ <parameter name="votes" type="string">
110
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
111
+ </parameter>
112
+ <parameter name="events" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ </choice>
116
+ </oneOrMore>
117
+ </message>
118
+ <message name="change_subscription">
100
119
  <optional>
101
120
  <parameter name="url" type="string"/>
102
121
  </optional>
@@ -141,10 +160,10 @@
141
160
  </resource>
142
161
  <resource relative="subscriptions">
143
162
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
163
+ <post in="create_subscription" out="acknowledgment"/>
145
164
  <resource>
146
165
  <get out="subscription"/>
147
- <put in="subscribe"/>
166
+ <put in="change_subscription"/>
148
167
  <delete/>
149
168
  <resource relative="sse">
150
169
  <sse/>
data/riddl.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.112"
3
+ s.version = "0.113"
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.112'
4
+ version: '0.113'
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: 2021-04-19 00:00:00.000000000 Z
13
+ date: 2021-06-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite
@@ -411,7 +411,6 @@ files:
411
411
  - examples/twitter/README
412
412
  - examples/twitter/client.rb
413
413
  - examples/twitter/declaration.xml
414
- - examples/twitter/timeline.rb
415
414
  - examples/twitter/twitpic.xml
416
415
  - examples/twitter/twitter.xml
417
416
  - examples/websocket/client.rb
@@ -549,7 +548,7 @@ 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.4
551
+ rubygems_version: 3.1.6
553
552
  signing_key:
554
553
  specification_version: 4
555
554
  summary: 'restful interface description and declaration language: tools and client/server
@@ -1,76 +0,0 @@
1
- #!/usr/bin/ruby
2
- require '../../lib/ruby/riddl/client'
3
- require 'json'
4
-
5
- twitter = Riddl::Client.interface("https://api.twitter.com/","twitter.xml")
6
-
7
- ### Base
8
- consumer_key = File.read(File.expand_path(File.dirname(__FILE__) + '/.twitter.consumer_key')).strip
9
- consumer_secret = File.read(File.expand_path(File.dirname(__FILE__) + '/.twitter.consumer_secret')).strip
10
- file_user_id = File.expand_path(File.dirname(__FILE__) + '/.twitter.user_id')
11
- file_token = File.expand_path(File.dirname(__FILE__) + '/.twitter.token')
12
- file_token_secret = File.expand_path(File.dirname(__FILE__) + '/.twitter.token_secret')
13
-
14
- ### When token and secret already saved, skip this part
15
- if !File.exists?(file_token) && !File.exists?(file_token_secret)
16
- ### go to request token resource and set necessary role options
17
- resource = twitter.resource("/oauth/request_token")
18
- params = [
19
- Riddl::Option.new(:consumer_key,consumer_key),
20
- Riddl::Option.new(:consumer_secret,consumer_secret)
21
- ]
22
-
23
- ### simulate request token
24
- # puts resource.simulate_post(params).read
25
-
26
- ### get request token and save it to variables
27
- status, response, headers = resource.post params
28
- token = response.oauth_token
29
- token_secret = response.oauth_token_secret
30
-
31
- ### send user away for authorization
32
- puts "Authorize at https://twitter.com/oauth/authorize?oauth_token=#{token}"
33
- print "Insert verifier here: "
34
- verifier = STDIN.gets.strip # wait for verifier
35
-
36
- ### exchange the token for an access token and save the results
37
- resource = twitter.resource("/oauth/access_token")
38
- status, response, headers = resource.post [
39
- Riddl::Option.new(:consumer_key,consumer_key),
40
- Riddl::Option.new(:consumer_secret,consumer_secret),
41
- Riddl::Option.new(:token,token),
42
- Riddl::Option.new(:verifier,verifier),
43
- Riddl::Option.new(:token_secret,token_secret)
44
- ]
45
- user_id = response.user_id
46
- token = response.oauth_token
47
- token_secret = response.oauth_token_secret
48
-
49
- File.open(file_user_id,'w'){|f|f.write response.oauth_token}
50
- File.open(file_token,'w'){|f|f.write response.oauth_token}
51
- File.open(file_token_secret,'w'){|f|f.write response.oauth_token_secret}
52
- else
53
- user_id = File.read(file_user_id).strip
54
- token = File.read(file_token).strip
55
- token_secret = File.read(file_token_secret).strip
56
- end
57
-
58
- ### Show single tweet
59
- #tweet = 258251258941554688 # some stuff
60
- #status, res = twitter.resource("/1.1/statuses/show.json").get [
61
- # Riddl::Parameter::Simple.new("id",tweet),
62
- # Riddl::Option.new(:consumer_key,consumer_key),
63
- # Riddl::Option.new(:consumer_secret,consumer_secret),
64
- # Riddl::Option.new(:token,token),
65
- # Riddl::Option.new(:token_secret,token_secret)
66
- #]
67
- #puts status
68
-
69
- ### Show timeline
70
- status, res = twitter.resource("/1.1/statuses/user_timeline.json").get [
71
- Riddl::Option.new(:consumer_key,consumer_key),
72
- Riddl::Option.new(:consumer_secret,consumer_secret),
73
- Riddl::Option.new(:token,token),
74
- Riddl::Option.new(:token_secret,token_secret)
75
- ]
76
- tweets = JSON::parse(res[0].value.read)