ribose 0.4.1 → 0.5.0
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 +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +8 -648
- data/CHANGELOG.adoc +36 -0
- data/{README.md → README.adoc} +414 -339
- data/lib/ribose/actions/create.rb +1 -1
- data/lib/ribose/client.rb +18 -18
- data/lib/ribose/configuration.rb +15 -7
- data/lib/ribose/event.rb +1 -1
- data/lib/ribose/file_uploader.rb +1 -1
- data/lib/ribose/file_version.rb +12 -16
- data/lib/ribose/request.rb +27 -30
- data/lib/ribose/response/raise_error.rb +0 -2
- data/lib/ribose/session.rb +47 -37
- data/lib/ribose/space_file.rb +1 -1
- data/lib/ribose/version.rb +1 -1
- data/lib/ribose/version_uploader.rb +1 -1
- data/ribose.gemspec +1 -1
- data/spec/ribose/client_spec.rb +18 -19
- data/spec/ribose/config_spec.rb +0 -1
- data/spec/ribose/file_uploader_spec.rb +2 -2
- data/spec/ribose/file_version_spec.rb +1 -1
- data/spec/ribose/message_spec.rb +3 -2
- data/spec/ribose/session_spec.rb +18 -24
- data/spec/ribose/space_file_spec.rb +1 -1
- data/spec/ribose/space_spec.rb +1 -1
- data/spec/ribose/user_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -1
- data/spec/support/fake_ribose_api.rb +2 -2
- metadata +7 -7
- data/CHANGELOG.md +0 -25
data/{README.md → README.adoc}
RENAMED
@@ -1,273 +1,302 @@
|
|
1
|
-
|
1
|
+
= Ribose
|
2
2
|
|
3
|
-
[
|
4
|
-
Status](https://travis-ci.org/riboseinc/ribose-ruby.svg?branch=master)](https://travis-ci.org/riboseinc/ribose-ruby)
|
5
|
-
[](https://codeclimate.com/github/riboseinc/ribose-ruby)
|
7
|
-
[](https://badge.fury.io/rb/ribose)
|
3
|
+
image:https://travis-ci.org/riboseinc/ribose-ruby.svg?branch=master[Build Status,link=https://travis-ci.org/riboseinc/ribose-ruby] image:https://codeclimate.com/github/riboseinc/ribose-ruby/badges/gpa.svg[Code Climate,link=https://codeclimate.com/github/riboseinc/ribose-ruby] image:https://badge.fury.io/rb/ribose.svg[Gem Version,link=https://badge.fury.io/rb/ribose]
|
8
4
|
|
9
5
|
The Ruby Interface to the Ribose API.
|
10
6
|
|
11
|
-
|
7
|
+
== Installation
|
12
8
|
|
13
9
|
Add this line to your application's Gemfile:
|
14
10
|
|
15
|
-
|
11
|
+
[source,ruby]
|
12
|
+
----
|
16
13
|
gem "ribose"
|
17
|
-
|
14
|
+
----
|
18
15
|
|
19
16
|
And then execute:
|
20
17
|
|
21
|
-
|
18
|
+
[source,sh]
|
19
|
+
----
|
22
20
|
$ bundle install
|
23
|
-
|
21
|
+
----
|
24
22
|
|
25
23
|
Or install it yourself as:
|
26
24
|
|
27
|
-
|
25
|
+
[source,sh]
|
26
|
+
----
|
28
27
|
$ gem install ribose
|
29
|
-
|
28
|
+
----
|
30
29
|
|
31
|
-
|
30
|
+
== Configure
|
32
31
|
|
33
|
-
We need to setup Ribose API configuration before we can perform any request
|
34
|
-
throughout this client
|
32
|
+
We need to setup Ribose API configuration before we can perform any request throughout this client
|
35
33
|
|
36
|
-
First, obtain an API token
|
37
|
-
Using the token, configure the client by adding an initializer with the
|
38
|
-
following code:
|
34
|
+
First, obtain an API token https://github.com/riboseinc/ribose-api/wiki/Obtaining-the-API-Token[as per this Github wiki].
|
35
|
+
Using the token, configure the client by adding an initializer with the following code:
|
39
36
|
|
40
|
-
|
37
|
+
[source,ruby]
|
38
|
+
----
|
41
39
|
Ribose.configure do |config|
|
42
|
-
config.
|
43
|
-
config.
|
40
|
+
config.user_email = "your-email@example.com"
|
41
|
+
config.user_password = "your-password"
|
42
|
+
|
43
|
+
# INFRA_ID is a 7-digit id, which can be found from the network requests
|
44
|
+
# e.g. ed6af7b for current production environment
|
45
|
+
config.api_host = URI.parse('https://app-INFRA_ID.ribose.com')
|
44
46
|
|
45
47
|
# There are also some default configurations. Normally you do not need to
|
46
48
|
# change those unless you have some very specific use cases.
|
47
49
|
#
|
48
50
|
# config.debug_mode = false
|
49
51
|
# config.api_host = "www.ribose.com"
|
52
|
+
|
53
|
+
# Deprecated
|
54
|
+
# config.api_token = "SECRET_API_TOKEN"
|
55
|
+
# config.api_email = "your-email@example.com"
|
50
56
|
end
|
51
|
-
|
57
|
+
----
|
52
58
|
|
53
59
|
Or:
|
54
60
|
|
55
|
-
|
56
|
-
|
61
|
+
[source,ruby]
|
62
|
+
----
|
63
|
+
Ribose.configuration.api_host = "https://app-INFRA_ID.ribose.com"
|
57
64
|
Ribose.configuration.user_email = "your-email@example.com"
|
65
|
+
Ribose.configuration.user_password = "your-password"
|
58
66
|
```
|
67
|
+
=======
|
68
|
+
----
|
59
69
|
|
60
|
-
|
70
|
+
== Usage
|
61
71
|
|
62
|
-
|
72
|
+
=== App Data
|
63
73
|
|
64
|
-
|
74
|
+
==== List app data
|
65
75
|
|
66
76
|
App data can be retrieved using the `AppData.all` interface.
|
67
77
|
|
68
|
-
|
78
|
+
[source,ruby]
|
79
|
+
----
|
69
80
|
Ribose::AppData.all
|
70
|
-
|
81
|
+
----
|
71
82
|
|
72
|
-
|
83
|
+
=== App Relation
|
73
84
|
|
74
|
-
|
85
|
+
==== List app relations
|
75
86
|
|
76
|
-
To retrieve the list of app relations, we can use the `AppRelation.all`
|
77
|
-
interface.
|
87
|
+
To retrieve the list of app relations, we can use the `AppRelation.all` interface.
|
78
88
|
|
79
|
-
|
89
|
+
[source,ruby]
|
90
|
+
----
|
80
91
|
Ribose::AppRelation.all
|
81
|
-
|
92
|
+
----
|
82
93
|
|
83
|
-
|
94
|
+
==== Fetch an app relation
|
84
95
|
|
85
|
-
To retrieve the details for a specific app relation, we can use the following
|
86
|
-
interface.
|
96
|
+
To retrieve the details for a specific app relation, we can use the following interface.
|
87
97
|
|
88
|
-
|
98
|
+
[source,ruby]
|
99
|
+
----
|
89
100
|
Ribose::AppRelation.fetch(app_relation_id)
|
90
|
-
|
101
|
+
----
|
91
102
|
|
92
|
-
|
103
|
+
=== Profile
|
93
104
|
|
94
|
-
|
105
|
+
==== Fetch user profile
|
95
106
|
|
96
|
-
|
107
|
+
[source,ruby]
|
108
|
+
----
|
97
109
|
Ribose::Profile.fetch
|
98
|
-
|
110
|
+
----
|
99
111
|
|
100
|
-
|
112
|
+
==== Update user profile
|
101
113
|
|
102
|
-
|
114
|
+
[source,ruby]
|
115
|
+
----
|
103
116
|
Ribose::Profile.update(first_name: "John", last_name: "Doe")
|
104
|
-
|
117
|
+
----
|
105
118
|
|
106
|
-
|
119
|
+
==== Set user login
|
107
120
|
|
108
|
-
|
121
|
+
[source,ruby]
|
122
|
+
----
|
109
123
|
Ribose::Profile.set_login(login_name)
|
110
|
-
|
124
|
+
----
|
111
125
|
|
112
|
-
|
126
|
+
=== Settings
|
113
127
|
|
114
|
-
|
128
|
+
==== List user's settings
|
115
129
|
|
116
|
-
To list user's settings we can use the `Setting.all` interface, and it will
|
117
|
-
return all of the user's settings.
|
130
|
+
To list user's settings we can use the `Setting.all` interface, and it will return all of the user's settings.
|
118
131
|
|
119
|
-
|
132
|
+
[source,ruby]
|
133
|
+
----
|
120
134
|
Ribose::Setting.all
|
121
|
-
|
135
|
+
----
|
122
136
|
|
123
|
-
|
137
|
+
==== Fetch a setting
|
124
138
|
|
125
|
-
To fetch the details for any specific settings we can use the `Setting.fetch`
|
126
|
-
interface with the specific Setting ID, and it will return the details for that
|
127
|
-
setting.
|
139
|
+
To fetch the details for any specific settings we can use the `Setting.fetch` interface with the specific Setting ID, and it will return the details for that setting.
|
128
140
|
|
129
|
-
|
141
|
+
[source,ruby]
|
142
|
+
----
|
130
143
|
Ribose::Setting.fetch(setting_id)
|
131
|
-
|
144
|
+
----
|
132
145
|
|
133
|
-
|
146
|
+
==== Update a setting
|
134
147
|
|
135
|
-
|
148
|
+
[source,ruby]
|
149
|
+
----
|
136
150
|
Ribose::Setting.update(setting_id, **new_updated_attributes_hash)
|
137
|
-
|
151
|
+
----
|
138
152
|
|
139
|
-
|
153
|
+
=== Spaces
|
140
154
|
|
141
|
-
|
155
|
+
==== List user's Spaces
|
142
156
|
|
143
|
-
To list a user's Spaces we can use the `Space.all` interface, and it will
|
144
|
-
retrieve all of the Spaces for the currently configured user.
|
157
|
+
To list a user's Spaces we can use the `Space.all` interface, and it will retrieve all of the Spaces for the currently configured user.
|
145
158
|
|
146
|
-
|
159
|
+
[source,ruby]
|
160
|
+
----
|
147
161
|
Ribose::Space.all
|
148
|
-
|
162
|
+
----
|
149
163
|
|
150
|
-
|
164
|
+
==== Fetch a user Space
|
151
165
|
|
152
166
|
To retrieve the details for a Space we can use the `Space.fetch(space_id)`.
|
153
167
|
|
154
|
-
|
168
|
+
[source,ruby]
|
169
|
+
----
|
155
170
|
Ribose::Space.fetch(space_id)
|
156
|
-
|
171
|
+
----
|
157
172
|
|
158
|
-
|
173
|
+
==== Create a user Space
|
159
174
|
|
160
175
|
To create a new user Space,
|
161
176
|
|
162
|
-
|
177
|
+
[source,ruby]
|
178
|
+
----
|
163
179
|
Ribose::Space.create(
|
164
180
|
access: "private",
|
165
181
|
space_category_id: 12,
|
166
182
|
name: "The amazing Ribose Space",
|
167
183
|
description: "Description about your Space"
|
168
184
|
)
|
169
|
-
|
185
|
+
----
|
170
186
|
|
171
|
-
|
187
|
+
==== Update a user Space
|
172
188
|
|
173
|
-
|
189
|
+
[source,ruby]
|
190
|
+
----
|
174
191
|
Ribose::Space.update("space_uuid", name: "New updated name", **other_attributes)
|
175
|
-
|
192
|
+
----
|
176
193
|
|
177
|
-
|
194
|
+
==== Remove a user Space
|
178
195
|
|
179
196
|
To remove an existing Space,
|
180
197
|
|
181
|
-
|
198
|
+
[source,ruby]
|
199
|
+
----
|
182
200
|
Ribose::Space.remove(space_uuid, confirmation: true)
|
183
|
-
|
201
|
+
----
|
184
202
|
|
185
|
-
|
203
|
+
=== Members
|
186
204
|
|
187
205
|
The members endpoint are Space-specific.
|
188
206
|
|
189
|
-
To retrieve the member details under any specific Space, we can use this
|
190
|
-
interface.
|
207
|
+
To retrieve the member details under any specific Space, we can use this interface.
|
191
208
|
|
192
|
-
|
209
|
+
==== List space members
|
193
210
|
|
194
211
|
To retrieve the list of members,
|
195
212
|
|
196
|
-
|
213
|
+
[source,ruby]
|
214
|
+
----
|
197
215
|
Ribose::Member.all(space_id, options)
|
198
|
-
|
216
|
+
----
|
199
217
|
|
200
|
-
|
218
|
+
==== Delete a space member
|
201
219
|
|
202
|
-
|
220
|
+
[source,ruby]
|
221
|
+
----
|
203
222
|
Ribose::Member.delete(space_id, member_id, options)
|
204
|
-
|
223
|
+
----
|
205
224
|
|
206
|
-
|
225
|
+
==== Fetch Member Role
|
207
226
|
|
208
|
-
|
227
|
+
[source,ruby]
|
228
|
+
----
|
209
229
|
Ribose::MemberRole.fetch(space_id, member_id, options)
|
210
|
-
|
230
|
+
----
|
211
231
|
|
212
|
-
|
232
|
+
==== Assign a role to member
|
213
233
|
|
214
|
-
|
234
|
+
[source,ruby]
|
235
|
+
----
|
215
236
|
Ribose::MemberRole.assign(space_id, member_id, role_id)
|
216
|
-
|
237
|
+
----
|
217
238
|
|
218
|
-
|
239
|
+
=== Files
|
219
240
|
|
220
|
-
|
241
|
+
==== List of Files
|
221
242
|
|
222
243
|
To retrieve the list of files for any specific Space,
|
223
244
|
|
224
|
-
|
245
|
+
[source,ruby]
|
246
|
+
----
|
225
247
|
Ribose::SpaceFile.all(space_id, options)
|
226
|
-
|
248
|
+
----
|
227
249
|
|
228
|
-
|
250
|
+
==== Fetch a file details
|
229
251
|
|
230
|
-
|
252
|
+
[source,ruby]
|
253
|
+
----
|
231
254
|
Ribose::SpaceFile.fetch(space_id, file_id, options = {})
|
232
|
-
|
255
|
+
----
|
233
256
|
|
234
|
-
|
257
|
+
==== Fetch a file icon
|
235
258
|
|
236
|
-
|
259
|
+
[source,ruby]
|
260
|
+
----
|
237
261
|
Ribose::SpaceFile.fetch_icon(space_id, file_id, options = {})
|
238
|
-
|
262
|
+
----
|
239
263
|
|
240
|
-
|
264
|
+
==== Create a file upload
|
241
265
|
|
242
|
-
|
266
|
+
[source,ruby]
|
267
|
+
----
|
243
268
|
Ribose::SpaceFile.create(space_id, file: "The complete file path", **attributes)
|
244
|
-
|
269
|
+
----
|
245
270
|
|
246
|
-
|
271
|
+
==== Update a space file
|
247
272
|
|
248
|
-
|
273
|
+
[source,ruby]
|
274
|
+
----
|
249
275
|
Ribose::SpaceFile.update(space_id, file_id, new_file_attributes = {})
|
250
|
-
|
276
|
+
----
|
251
277
|
|
252
|
-
|
278
|
+
==== Remove a space file
|
253
279
|
|
254
|
-
|
280
|
+
[source,ruby]
|
281
|
+
----
|
255
282
|
Ribose::SpaceFile.delete(space_id, file_id)
|
256
|
-
|
283
|
+
----
|
257
284
|
|
258
|
-
|
285
|
+
=== File Version
|
259
286
|
|
260
|
-
|
287
|
+
==== Fetch file version
|
261
288
|
|
262
|
-
|
289
|
+
[source,ruby]
|
290
|
+
----
|
263
291
|
Ribose::FileVersion.fetch(
|
264
292
|
space_id: space_id, file_id: file_id, version_id: version_id
|
265
293
|
)
|
266
|
-
|
294
|
+
----
|
267
295
|
|
268
|
-
|
296
|
+
==== Create a new file version
|
269
297
|
|
270
|
-
|
298
|
+
[source,ruby]
|
299
|
+
----
|
271
300
|
Ribose::FileVersion.create(
|
272
301
|
space_id: your_space_id,
|
273
302
|
file_id: existing_file_id_in_space,
|
@@ -275,206 +304,229 @@ Ribose::FileVersion.create(
|
|
275
304
|
|
276
305
|
**any_other_additional_attributes
|
277
306
|
)
|
278
|
-
|
307
|
+
----
|
279
308
|
|
280
|
-
|
309
|
+
=== Conversations
|
281
310
|
|
282
|
-
|
311
|
+
==== Listing Space Conversations
|
283
312
|
|
284
|
-
|
313
|
+
[source,ruby]
|
314
|
+
----
|
285
315
|
Ribose::Conversation.all(space_id, options = {})
|
286
|
-
|
316
|
+
----
|
287
317
|
|
288
|
-
|
318
|
+
==== Retrieve a conversation details
|
289
319
|
|
290
|
-
|
320
|
+
[source,ruby]
|
321
|
+
----
|
291
322
|
Ribose::Conversation.fetch(space_id, conversation_id)
|
292
|
-
|
323
|
+
----
|
293
324
|
|
294
|
-
|
325
|
+
==== Create A New Conversation
|
295
326
|
|
296
|
-
|
327
|
+
[source,ruby]
|
328
|
+
----
|
297
329
|
Ribose::Conversation.create(
|
298
330
|
space_id, name: "Sample conversation", tag_list: "sample, conversation"
|
299
331
|
)
|
300
|
-
|
332
|
+
----
|
301
333
|
|
302
|
-
|
334
|
+
==== Update a conversation
|
303
335
|
|
304
|
-
|
336
|
+
[source,ruby]
|
337
|
+
----
|
305
338
|
Ribose::Conversation.update(space_id, conversation_id, new_attributes_hash)
|
306
|
-
|
339
|
+
----
|
307
340
|
|
308
|
-
|
341
|
+
==== Remove A Conversation
|
309
342
|
|
310
|
-
|
343
|
+
[source,ruby]
|
344
|
+
----
|
311
345
|
Ribose::Conversation.destroy(space_id: "space_id", conversation_id: "12345")
|
312
|
-
|
346
|
+
----
|
313
347
|
|
314
|
-
|
348
|
+
==== Mark a conversation as favorite
|
315
349
|
|
316
|
-
|
350
|
+
[source,ruby]
|
351
|
+
----
|
317
352
|
Ribose::Conversation.mark_as_favorite(space_id, conversation_id)
|
318
|
-
|
353
|
+
----
|
319
354
|
|
320
|
-
|
355
|
+
=== Message
|
321
356
|
|
322
|
-
|
357
|
+
==== List Conversation Messages
|
323
358
|
|
324
|
-
|
359
|
+
[source,ruby]
|
360
|
+
----
|
325
361
|
Ribose::Message.all(space_id: space_uuid, conversation_id: conversation_uuid)
|
326
|
-
|
362
|
+
----
|
327
363
|
|
328
|
-
|
364
|
+
==== Create a new message
|
329
365
|
|
330
|
-
|
366
|
+
[source,ruby]
|
367
|
+
----
|
331
368
|
Ribose::Message.create(
|
332
369
|
space_id: space_uuid,
|
333
370
|
conversation_id: conversation_uuid,
|
334
371
|
contents: "Provide your message body here",
|
335
372
|
)
|
336
|
-
|
373
|
+
----
|
337
374
|
|
338
|
-
|
375
|
+
==== Update an existing message
|
339
376
|
|
340
|
-
|
377
|
+
[source,ruby]
|
378
|
+
----
|
341
379
|
Ribose::Message.update(
|
342
380
|
space_id: space_uuid,
|
343
381
|
message_id: message_uuid,
|
344
382
|
conversation_id: conversation_uuid,
|
345
383
|
contents: "The new content for message",
|
346
384
|
)
|
347
|
-
|
385
|
+
----
|
348
386
|
|
349
|
-
|
387
|
+
==== Remove a message
|
350
388
|
|
351
|
-
|
389
|
+
[source,ruby]
|
390
|
+
----
|
352
391
|
Ribose::Message.remove(
|
353
392
|
space_id: space_uuid,
|
354
393
|
message_id: message_uuid,
|
355
394
|
conversation_id: conversation_uuid,
|
356
395
|
)
|
357
|
-
|
396
|
+
----
|
358
397
|
|
359
|
-
|
398
|
+
=== Feeds
|
360
399
|
|
361
|
-
|
400
|
+
==== List user feeds
|
362
401
|
|
363
402
|
To retrieve the list of user feeds,
|
364
403
|
|
365
|
-
|
404
|
+
[source,ruby]
|
405
|
+
----
|
366
406
|
Ribose::Feed.all
|
367
|
-
|
407
|
+
----
|
368
408
|
|
369
|
-
|
409
|
+
=== Widgets
|
370
410
|
|
371
|
-
|
411
|
+
==== List widgets
|
372
412
|
|
373
413
|
To retrieve the list of widgets,
|
374
414
|
|
375
|
-
|
415
|
+
[source,ruby]
|
416
|
+
----
|
376
417
|
Ribose::Widget.all
|
377
|
-
|
418
|
+
----
|
378
419
|
|
379
|
-
|
420
|
+
=== Stream
|
380
421
|
|
381
|
-
|
422
|
+
==== List of stream notifications
|
382
423
|
|
383
424
|
To retrieve the list of notifications,
|
384
425
|
|
385
|
-
|
426
|
+
[source,ruby]
|
427
|
+
----
|
386
428
|
Ribose::Stream.all
|
387
|
-
|
429
|
+
----
|
388
430
|
|
389
|
-
|
431
|
+
=== Leaderboard
|
390
432
|
|
391
|
-
|
433
|
+
==== Retrieve the current leadership board
|
392
434
|
|
393
435
|
To retrieve the current leadership board,
|
394
436
|
|
395
|
-
|
437
|
+
[source,ruby]
|
438
|
+
----
|
396
439
|
Ribose::Leaderboard.all
|
397
|
-
|
440
|
+
----
|
398
441
|
|
399
|
-
|
442
|
+
=== Connections
|
400
443
|
|
401
|
-
|
444
|
+
==== List of connections
|
402
445
|
|
403
|
-
To retrieve the list of connections, we can use the `Connection.all` interface
|
404
|
-
and it will return the connection as `Sawyer::Resource`.
|
446
|
+
To retrieve the list of connections, we can use the `Connection.all` interface and it will return the connection as `Sawyer::Resource`.
|
405
447
|
|
406
|
-
|
448
|
+
[source,ruby]
|
449
|
+
----
|
407
450
|
Ribose::Connection.all
|
408
|
-
|
451
|
+
----
|
409
452
|
|
410
|
-
|
453
|
+
==== Disconnect a connection
|
411
454
|
|
412
|
-
To disconnect with an existing connection, we can use `Connection.disconnect`
|
413
|
-
|
414
|
-
support an additional options hash to provide custom options.
|
455
|
+
To disconnect with an existing connection, we can use `Connection.disconnect` interface as following.
|
456
|
+
This expect us to provide the connection id, and it also support an additional options hash to provide custom options.
|
415
457
|
|
416
|
-
|
458
|
+
[source,ruby]
|
459
|
+
----
|
417
460
|
Ribose::Connection.disconnect(connection_id, options)
|
418
|
-
|
461
|
+
----
|
419
462
|
|
420
|
-
|
463
|
+
==== Connection suggestions
|
421
464
|
|
422
465
|
To retrieve the list of user connection suggestions,
|
423
466
|
|
424
|
-
|
467
|
+
[source,ruby]
|
468
|
+
----
|
425
469
|
Ribose::Connection.suggestions
|
426
|
-
|
470
|
+
----
|
427
471
|
|
428
|
-
|
472
|
+
=== Invitations
|
429
473
|
|
430
|
-
|
474
|
+
==== List connection invitations
|
431
475
|
|
432
|
-
|
476
|
+
[source,ruby]
|
477
|
+
----
|
433
478
|
Ribose::ConnectionInvitation.all
|
434
|
-
|
479
|
+
----
|
435
480
|
|
436
|
-
|
481
|
+
==== List Space invitations
|
437
482
|
|
438
|
-
|
483
|
+
[source,ruby]
|
484
|
+
----
|
439
485
|
Ribose::SpaceInvitation.all
|
440
|
-
|
486
|
+
----
|
441
487
|
|
442
|
-
|
488
|
+
==== Fetch a connection invitation
|
443
489
|
|
444
|
-
|
490
|
+
[source,ruby]
|
491
|
+
----
|
445
492
|
Ribose::ConnectionInvitation.fetch(invitation_id)
|
446
|
-
|
493
|
+
----
|
447
494
|
|
448
|
-
|
495
|
+
==== Create mass connection invitations
|
449
496
|
|
450
|
-
|
497
|
+
[source,ruby]
|
498
|
+
----
|
451
499
|
Ribose::ConnectionInvitation.create(
|
452
500
|
emails: ["email-one@example.com", "email-two@example.com"],
|
453
501
|
body: "This contains the details message about the invitation",
|
454
502
|
)
|
455
|
-
|
503
|
+
----
|
456
504
|
|
457
|
-
|
505
|
+
==== Accept a connection invitation
|
458
506
|
|
459
|
-
|
507
|
+
[source,ruby]
|
508
|
+
----
|
460
509
|
Ribose::ConnectionInvitation.accept(invitation_id)
|
461
|
-
|
510
|
+
----
|
462
511
|
|
463
|
-
|
512
|
+
==== Reject a connection invitation
|
464
513
|
|
465
|
-
|
514
|
+
[source,ruby]
|
515
|
+
----
|
466
516
|
Ribose::ConnectionInvitation.reject(invitation_id)
|
467
|
-
|
517
|
+
----
|
468
518
|
|
469
|
-
|
519
|
+
==== Cancel a connection invitation
|
470
520
|
|
471
|
-
|
521
|
+
[source,ruby]
|
522
|
+
----
|
472
523
|
Ribose::ConnectionInvitation.cancel(invitation_id)
|
473
|
-
|
524
|
+
----
|
474
525
|
|
475
|
-
|
526
|
+
==== Invite user to a Space
|
476
527
|
|
477
|
-
|
528
|
+
[source,ruby]
|
529
|
+
----
|
478
530
|
Ribose::SpaceInvitation.create(
|
479
531
|
state: "0",
|
480
532
|
space_id: "123_456_789",
|
@@ -482,141 +534,160 @@ Ribose::SpaceInvitation.create(
|
|
482
534
|
type: "Invitation::ToSpace",
|
483
535
|
body: "Please join to this amazing Space",
|
484
536
|
)
|
485
|
-
|
537
|
+
----
|
486
538
|
|
487
|
-
|
539
|
+
==== Create Space invitation - Mass
|
488
540
|
|
489
|
-
|
541
|
+
[source,ruby]
|
542
|
+
----
|
490
543
|
Ribose::SpaceInvitation.mass_create(
|
491
544
|
space_id,
|
492
545
|
emails: ["email-one@example.com"],
|
493
546
|
role_ids: ["role-for-email-address-in-sequance"],
|
494
547
|
body: "The complete message body for the invitation",
|
495
548
|
)
|
496
|
-
|
549
|
+
----
|
497
550
|
|
498
|
-
|
551
|
+
==== Update a Space invitation
|
499
552
|
|
500
|
-
|
553
|
+
[source,ruby]
|
554
|
+
----
|
501
555
|
Ribose::SpaceInvitation.update(invitation_id, new_attributes_hash)
|
502
|
-
|
556
|
+
----
|
503
557
|
|
504
|
-
|
558
|
+
==== Accept a Space invitation
|
505
559
|
|
506
|
-
|
560
|
+
[source,ruby]
|
561
|
+
----
|
507
562
|
Ribose::SpaceInvitation.accept(invitation_id)
|
508
|
-
|
563
|
+
----
|
509
564
|
|
510
|
-
|
565
|
+
==== Resend a Space invitation
|
511
566
|
|
512
|
-
|
567
|
+
[source,ruby]
|
568
|
+
----
|
513
569
|
Ribose::SpaceInvitation.resend(invitation_id)
|
514
|
-
|
570
|
+
----
|
515
571
|
|
516
|
-
|
572
|
+
==== Reject a Space invitation
|
517
573
|
|
518
|
-
|
574
|
+
[source,ruby]
|
575
|
+
----
|
519
576
|
Ribose::SpaceInvitation.reject(invitation_id)
|
520
|
-
|
577
|
+
----
|
521
578
|
|
522
|
-
|
579
|
+
==== Cancel a Space invitation
|
523
580
|
|
524
|
-
|
581
|
+
[source,ruby]
|
582
|
+
----
|
525
583
|
Ribose::SpaceInvitation.cancel(invitation_id)
|
526
|
-
|
584
|
+
----
|
527
585
|
|
528
|
-
|
586
|
+
=== Join Space Request
|
529
587
|
|
530
|
-
|
588
|
+
==== List Join Space Requests
|
531
589
|
|
532
|
-
|
590
|
+
[source,ruby]
|
591
|
+
----
|
533
592
|
Ribose::JoinSpaceRequest.all
|
534
|
-
|
593
|
+
----
|
535
594
|
|
536
|
-
|
595
|
+
==== Fetch a join space request
|
537
596
|
|
538
|
-
|
597
|
+
[source,ruby]
|
598
|
+
----
|
539
599
|
Ribose::JoinSpaceRequest.fetch(request_id)
|
540
|
-
|
600
|
+
----
|
541
601
|
|
542
|
-
|
602
|
+
==== Create a Join Space Request
|
543
603
|
|
544
|
-
|
604
|
+
[source,ruby]
|
605
|
+
----
|
545
606
|
Ribose::JoinSpaceRequest.create(
|
546
607
|
state: 0,
|
547
608
|
Space_id: 123_456_789,
|
548
609
|
type: "Invitation::JoinSpaceRequest",
|
549
610
|
body: "Hi, I would like to join to your Space",
|
550
611
|
)
|
551
|
-
|
612
|
+
----
|
552
613
|
|
553
|
-
|
614
|
+
==== Accept a Join Space Request
|
554
615
|
|
555
|
-
|
616
|
+
[source,ruby]
|
617
|
+
----
|
556
618
|
Ribose::JoinSpaceRequest.accept(invitation_id)
|
557
|
-
|
619
|
+
----
|
558
620
|
|
559
|
-
|
621
|
+
==== Reject a Join Space Requests
|
560
622
|
|
561
|
-
|
623
|
+
[source,ruby]
|
624
|
+
----
|
562
625
|
Ribose::JoinSpaceRequest.reject(invitation_id)
|
563
|
-
|
626
|
+
----
|
564
627
|
|
565
|
-
|
628
|
+
==== Update an Join Space Requests
|
566
629
|
|
567
|
-
|
630
|
+
[source,ruby]
|
631
|
+
----
|
568
632
|
Ribose::JoinSpaceRequest.update(invitation_id, new_attributes_hash)
|
569
|
-
|
633
|
+
----
|
570
634
|
|
571
|
-
|
635
|
+
=== Calendar
|
572
636
|
|
573
|
-
|
637
|
+
==== List user calendars
|
574
638
|
|
575
639
|
To retrieve the list of calendars accessible to the current user,
|
576
640
|
|
577
|
-
|
641
|
+
[source,ruby]
|
642
|
+
----
|
578
643
|
Ribose::Calendar.all
|
579
|
-
|
644
|
+
----
|
580
645
|
|
581
|
-
|
646
|
+
==== Fetch a calendar events
|
582
647
|
|
583
|
-
|
648
|
+
[source,ruby]
|
649
|
+
----
|
584
650
|
Ribose::Calendar.fetch(calendar_ids, start: Data.today, length: 7)
|
585
|
-
|
651
|
+
----
|
586
652
|
|
587
|
-
|
653
|
+
==== Create a calendar
|
588
654
|
|
589
|
-
|
655
|
+
[source,ruby]
|
656
|
+
----
|
590
657
|
Ribose::Calendar.create(
|
591
658
|
owner_type: "User",
|
592
659
|
owner_id: "The Owner UUID",
|
593
660
|
name: "The name for the calendar",
|
594
661
|
)
|
595
|
-
|
662
|
+
----
|
596
663
|
|
597
|
-
|
664
|
+
==== Delete a calendar
|
598
665
|
|
599
|
-
|
666
|
+
[source,ruby]
|
667
|
+
----
|
600
668
|
Ribose::Calendar.delete(calendar_id)
|
601
|
-
|
669
|
+
----
|
602
670
|
|
603
|
-
|
671
|
+
=== Event
|
604
672
|
|
605
|
-
|
673
|
+
==== List calendar events
|
606
674
|
|
607
|
-
|
675
|
+
[source,ruby]
|
676
|
+
----
|
608
677
|
Ribose::Event.all(calendar_id)
|
609
|
-
|
678
|
+
----
|
610
679
|
|
611
|
-
|
680
|
+
==== Fetch a calendar event
|
612
681
|
|
613
|
-
|
682
|
+
[source,ruby]
|
683
|
+
----
|
614
684
|
Ribose::Event.fetch(calendar_id, event_id)
|
615
|
-
|
685
|
+
----
|
616
686
|
|
617
|
-
|
687
|
+
==== Create a calendar event
|
618
688
|
|
619
|
-
|
689
|
+
[source,ruby]
|
690
|
+
----
|
620
691
|
Ribose::Event.create(
|
621
692
|
calendar_id,
|
622
693
|
name: "Sample Event",
|
@@ -631,137 +702,141 @@ Ribose::Event.create(
|
|
631
702
|
description: "Sample event",
|
632
703
|
all_day: false,
|
633
704
|
)
|
634
|
-
|
705
|
+
----
|
635
706
|
|
636
|
-
|
707
|
+
==== Update a calendar event
|
637
708
|
|
638
|
-
|
709
|
+
[source,ruby]
|
710
|
+
----
|
639
711
|
Ribose::Event.update(
|
640
712
|
calendar_id, event_id, new_attributes_hash, options_params
|
641
713
|
)
|
642
|
-
|
714
|
+
----
|
643
715
|
|
644
|
-
|
716
|
+
==== Delete a calendar event
|
645
717
|
|
646
|
-
|
718
|
+
[source,ruby]
|
719
|
+
----
|
647
720
|
Ribose::Event.delete(calendar_id, event_id)
|
648
|
-
|
721
|
+
----
|
649
722
|
|
650
|
-
|
723
|
+
=== User
|
651
724
|
|
652
|
-
|
725
|
+
==== Create a signup request
|
653
726
|
|
654
|
-
|
727
|
+
[source,ruby]
|
728
|
+
----
|
655
729
|
Ribose::User.create(email: "user@example.com", **other_attributes)
|
656
|
-
|
730
|
+
----
|
657
731
|
|
658
|
-
|
732
|
+
==== Activate a signup request
|
659
733
|
|
660
|
-
|
734
|
+
[source,ruby]
|
735
|
+
----
|
661
736
|
Ribose::User.activate(
|
662
737
|
email: "user@example.com",
|
663
738
|
password: "ASecureUserPassword",
|
664
739
|
otp: "OTP Recived via the Email",
|
665
740
|
)
|
666
|
-
|
741
|
+
----
|
667
742
|
|
668
|
-
|
743
|
+
=== Wikis
|
669
744
|
|
670
|
-
|
745
|
+
==== List wiki pages
|
671
746
|
|
672
|
-
|
747
|
+
[source,ruby]
|
748
|
+
----
|
673
749
|
Ribose::Wiki.all(space_id, options = {})
|
674
|
-
|
750
|
+
----
|
675
751
|
|
676
|
-
|
752
|
+
==== Fetch a wiki page
|
677
753
|
|
678
|
-
|
754
|
+
[source,ruby]
|
755
|
+
----
|
679
756
|
Ribose::Wiki.fetch(space_id, wiki_id, options = {})
|
680
|
-
|
757
|
+
----
|
681
758
|
|
682
|
-
|
759
|
+
==== Create a wiki page
|
683
760
|
|
684
|
-
|
761
|
+
[source,ruby]
|
762
|
+
----
|
685
763
|
Ribose::Wiki.create(
|
686
764
|
space_id, name: "Wiki Name", tag_list: "sample", **other_attributes_hash
|
687
765
|
)
|
688
|
-
|
766
|
+
----
|
689
767
|
|
690
|
-
|
768
|
+
==== Update a wiki page
|
691
769
|
|
692
|
-
|
770
|
+
[source,ruby]
|
771
|
+
----
|
693
772
|
Ribose::Wiki.update(
|
694
773
|
space_id, wiki_id, **updated_attributes_hash
|
695
774
|
)
|
696
|
-
|
775
|
+
----
|
697
776
|
|
698
|
-
|
777
|
+
==== Remove a wiki page
|
699
778
|
|
700
|
-
|
779
|
+
[source,ruby]
|
780
|
+
----
|
701
781
|
Ribose::Wiki.delete(space_id, wiki_id)
|
702
|
-
|
782
|
+
----
|
703
783
|
|
704
|
-
|
784
|
+
=== Space categories
|
705
785
|
|
706
|
-
|
786
|
+
==== List space categories
|
707
787
|
|
708
|
-
|
788
|
+
[source,ruby]
|
789
|
+
----
|
709
790
|
Ribose::SpaceCategory.all
|
710
|
-
|
791
|
+
----
|
711
792
|
|
712
|
-
|
793
|
+
== Development
|
713
794
|
|
714
|
-
We are following Sandi Metz's Rules for this gem, you can read the
|
715
|
-
|
716
|
-
rules. If you make changes in a pre-existing file that violates these rules you
|
717
|
-
should fix the violations as part of your contribution.
|
795
|
+
We are following Sandi Metz's Rules for this gem, you can read the http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers[description of the rules here] All new code should follow these rules.
|
796
|
+
If you make changes in a pre-existing file that violates these rules you should fix the violations as part of your contribution.
|
718
797
|
|
719
|
-
|
798
|
+
=== Setup
|
720
799
|
|
721
800
|
Clone the repository.
|
722
801
|
|
723
|
-
|
802
|
+
[source,sh]
|
803
|
+
----
|
724
804
|
git clone https://github.com/riboseinc/ribose-ruby
|
725
|
-
|
805
|
+
----
|
726
806
|
|
727
807
|
Setup your environment.
|
728
808
|
|
729
|
-
|
809
|
+
[source,sh]
|
810
|
+
----
|
730
811
|
bin/setup
|
731
|
-
|
812
|
+
----
|
732
813
|
|
733
814
|
Run the test suite
|
734
815
|
|
735
|
-
|
816
|
+
[source,sh]
|
817
|
+
----
|
736
818
|
bin/rspec
|
737
|
-
|
819
|
+
----
|
738
820
|
|
739
|
-
|
821
|
+
== Contributing
|
740
822
|
|
741
|
-
First, thank you for contributing!
|
742
|
-
|
743
|
-
right to grant or transfer an unlimited number of non exclusive licenses or
|
744
|
-
sub-licenses to third parties, under the copyright covering the contribution
|
745
|
-
to use the contribution by all means.
|
823
|
+
First, thank you for contributing!
|
824
|
+
We love pull requests from everyone.
|
825
|
+
By participating in this project, you hereby grant https://www.ribose.com[Ribose Inc.] the right to grant or transfer an unlimited number of non exclusive licenses or sub-licenses to third parties, under the copyright covering the contribution to use the contribution by all means.
|
746
826
|
|
747
827
|
Here are a few technical guidelines to follow:
|
748
828
|
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
## Credits
|
829
|
+
. Open an https://github.com/riboseinc/ribose-ruby/issues[issue] to discuss a new feature.
|
830
|
+
. Write tests to support your new feature.
|
831
|
+
. Make sure the entire test suite passes locally and on CI.
|
832
|
+
. Open a Pull Request.
|
833
|
+
. https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature[Squash your commits] after receiving feedback.
|
834
|
+
. Party!
|
757
835
|
|
758
|
-
|
836
|
+
== Credits
|
759
837
|
|
760
|
-
|
838
|
+
This gem is developed, maintained and funded by https://www.ribose.com[Ribose Inc.]
|
761
839
|
|
762
|
-
|
840
|
+
== License
|
763
841
|
|
764
|
-
|
765
|
-
[issues]: https://github.com/riboseinc/ribose-ruby/issues
|
766
|
-
[squash]: https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature
|
767
|
-
[sandi-metz]: http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers
|
842
|
+
The gem is available as open source under the terms of the http://opensource.org/licenses/MIT[MIT License].
|