ably-rest 0.8.15 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/submodules/ably-ruby/CHANGELOG.md +61 -48
  3. data/lib/submodules/ably-ruby/README.md +0 -6
  4. data/lib/submodules/ably-ruby/ably.gemspec +1 -1
  5. data/lib/submodules/ably-ruby/lib/ably/auth.rb +37 -32
  6. data/lib/submodules/ably-ruby/lib/ably/modules/event_emitter.rb +15 -30
  7. data/lib/submodules/ably-ruby/lib/ably/modules/model_common.rb +0 -25
  8. data/lib/submodules/ably-ruby/lib/ably/realtime/auth.rb +30 -18
  9. data/lib/submodules/ably-ruby/lib/ably/realtime/channel/channel_manager.rb +3 -3
  10. data/lib/submodules/ably-ruby/lib/ably/realtime/client.rb +0 -3
  11. data/lib/submodules/ably-ruby/lib/ably/realtime/client/incoming_message_dispatcher.rb +2 -2
  12. data/lib/submodules/ably-ruby/lib/ably/realtime/connection/connection_manager.rb +3 -3
  13. data/lib/submodules/ably-ruby/lib/ably/realtime/presence/members_map.rb +3 -3
  14. data/lib/submodules/ably-ruby/lib/ably/rest/client.rb +6 -6
  15. data/lib/submodules/ably-ruby/lib/ably/version.rb +2 -2
  16. data/lib/submodules/ably-ruby/spec/acceptance/realtime/auth_spec.rb +66 -53
  17. data/lib/submodules/ably-ruby/spec/acceptance/realtime/channel_spec.rb +8 -10
  18. data/lib/submodules/ably-ruby/spec/acceptance/realtime/client_spec.rb +3 -3
  19. data/lib/submodules/ably-ruby/spec/acceptance/realtime/connection_spec.rb +12 -48
  20. data/lib/submodules/ably-ruby/spec/acceptance/realtime/presence_spec.rb +38 -79
  21. data/lib/submodules/ably-ruby/spec/acceptance/rest/auth_spec.rb +74 -40
  22. data/lib/submodules/ably-ruby/spec/acceptance/rest/base_spec.rb +1 -1
  23. data/lib/submodules/ably-ruby/spec/acceptance/rest/channel_spec.rb +4 -2
  24. data/lib/submodules/ably-ruby/spec/acceptance/rest/client_spec.rb +21 -26
  25. data/lib/submodules/ably-ruby/spec/acceptance/rest/presence_spec.rb +12 -10
  26. data/lib/submodules/ably-ruby/spec/unit/modules/event_emitter_spec.rb +51 -109
  27. data/lib/submodules/ably-ruby/spec/unit/realtime/presence_spec.rb +3 -3
  28. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48424ef72497c2751ac21a896c3ccd2efeb4d565
4
- data.tar.gz: 70c5800da531e11fe13ddf904be8aa1aaeb1d7eb
3
+ metadata.gz: 01450cb037d2de42c0761a71bcfcdbaef488dcd6
4
+ data.tar.gz: 9b6dae68df0d53227815a4dee62169f373e040ab
5
5
  SHA512:
6
- metadata.gz: 609bc1f34bab805c54141889d429b341e2648cbc08591ba56f30b31246c175902eb7369156022f7e0d710e186dac04ce88e05b6c84e940e82d094609388fdaa6
7
- data.tar.gz: 67fd51774c985327152ad7fda6d448e791d37d58ace59709615560899f56ddc531029c3873a21df8c1a4ff05cf8121cfc6f237a6c0e8b1154917cbcad5709442
6
+ metadata.gz: a8b94e3e03348bdd861e23c005de04bbf047d24f896e5c249a0bf7bc8edf9c13b1d63cf38d764fbacd027e3c5e1937f8d890d5b29a52979ac765f6abb3f36582
7
+ data.tar.gz: 36fae4dc9d10ec4b8bc8f5f1137b9d41f169d83b346edd7912288e72dd8533c0a3c9acec438d055b345b1c15c15d03f09cfab50d09f41b04255f9333f33bf636
@@ -1,52 +1,7 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.8.15](https://github.com/ably/ably-ruby/tree/v0.8.15)
3
+ ## [v0.8.14](https://github.com/ably/ably-ruby/tree/v0.8.14)
4
4
 
5
- [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.14...v0.8.15)
6
-
7
- **Implemented enhancements:**
8
-
9
- - Fix HttpRequest & HttpRetry timeouts [\#110](https://github.com/ably/ably-ruby/issues/110)
10
- - Logger should take blocks [\#107](https://github.com/ably/ably-ruby/issues/107)
11
- - 0.9: Use separate internal/external listeners [\#106](https://github.com/ably/ably-ruby/issues/106)
12
- - Add reuse library test [\#83](https://github.com/ably/ably-ruby/issues/83)
13
- - 0.8 final spec check [\#71](https://github.com/ably/ably-ruby/issues/71)
14
- - Use connection\#id not connection\#key to determine if connection has been resumed [\#62](https://github.com/ably/ably-ruby/issues/62)
15
- - Channel Presence suspended state [\#41](https://github.com/ably/ably-ruby/issues/41)
16
- - Attach / detach timeouts + protocol error handling for Channel [\#38](https://github.com/ably/ably-ruby/issues/38)
17
- - Connection retry and timeout needs to be configurable [\#6](https://github.com/ably/ably-ruby/issues/6)
18
-
19
- **Fixed bugs:**
20
-
21
- - Subscribing to all connection state changes doesn't work [\#103](https://github.com/ably/ably-ruby/issues/103)
22
- - Ensure DETACHED or DISCONNECTED with error is non-fatal [\#93](https://github.com/ably/ably-ruby/issues/93)
23
- - Incorrect assumption for channel errors [\#91](https://github.com/ably/ably-ruby/issues/91)
24
- - authCallback assumes a blocking callback, even in EM [\#89](https://github.com/ably/ably-ruby/issues/89)
25
- - Token Reauth error codes [\#86](https://github.com/ably/ably-ruby/issues/86)
26
- - Do not persist authorise attributes force & timestamp [\#72](https://github.com/ably/ably-ruby/issues/72)
27
- - 0.8 final spec check [\#71](https://github.com/ably/ably-ruby/issues/71)
28
- - Receiving CONNECTED when already connected [\#69](https://github.com/ably/ably-ruby/issues/69)
29
- - Connection\#connect callback may not be called as expected [\#68](https://github.com/ably/ably-ruby/issues/68)
30
- - nodename nor servname provided [\#65](https://github.com/ably/ably-ruby/issues/65)
31
- - Channel Presence suspended state [\#41](https://github.com/ably/ably-ruby/issues/41)
32
- - Intermittent test fixes [\#33](https://github.com/ably/ably-ruby/issues/33)
33
-
34
- **Closed issues:**
35
-
36
- - Remove deprecated ProtocolMessage\#connectionKey [\#108](https://github.com/ably/ably-ruby/issues/108)
37
- - 0.9 Extras field [\#105](https://github.com/ably/ably-ruby/issues/105)
38
- - 0.9 UPDATE spec [\#104](https://github.com/ably/ably-ruby/issues/104)
39
- - Token issue bug [\#75](https://github.com/ably/ably-ruby/issues/75)
40
- - Ensure client\_id provided is string or cast to string in Auth request\_token [\#74](https://github.com/ably/ably-ruby/issues/74)
41
- - Standardise timeouts [\#64](https://github.com/ably/ably-ruby/issues/64)
42
- - Ensure RSpec retry compatibility is used [\#54](https://github.com/ably/ably-ruby/issues/54)
43
- - Spec validation [\#43](https://github.com/ably/ably-ruby/issues/43)
44
-
45
- **Merged pull requests:**
46
-
47
- - From encoded [\#101](https://github.com/ably/ably-ruby/pull/101) ([mattheworiordan](https://github.com/mattheworiordan))
48
-
49
- ## [v0.8.14](https://github.com/ably/ably-ruby/tree/v0.8.14) (2016-09-30)
50
5
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.13...v0.8.14)
51
6
 
52
7
  **Fixed bugs:**
@@ -62,6 +17,7 @@
62
17
  - Fallback host improvements [\#97](https://github.com/ably/ably-ruby/pull/97) ([mattheworiordan](https://github.com/mattheworiordan))
63
18
 
64
19
  ## [v0.8.13](https://github.com/ably/ably-ruby/tree/v0.8.13) (2016-09-29)
20
+
65
21
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.12...v0.8.13)
66
22
 
67
23
  **Merged pull requests:**
@@ -69,6 +25,7 @@
69
25
  - Ensure interoperability with other libraries with JSON protocol [\#94](https://github.com/ably/ably-ruby/pull/94) ([mattheworiordan](https://github.com/mattheworiordan))
70
26
 
71
27
  ## [v0.8.12](https://github.com/ably/ably-ruby/tree/v0.8.12) (2016-05-23)
28
+
72
29
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.11...v0.8.12)
73
30
 
74
31
  **Fixed bugs:**
@@ -80,6 +37,7 @@
80
37
  - Reauthorise [\#90](https://github.com/ably/ably-ruby/pull/90) ([mattheworiordan](https://github.com/mattheworiordan))
81
38
 
82
39
  ## [v0.8.11](https://github.com/ably/ably-ruby/tree/v0.8.11) (2016-04-05)
40
+
83
41
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.10...v0.8.11)
84
42
 
85
43
  **Merged pull requests:**
@@ -87,14 +45,17 @@
87
45
  - Ensure message emitter callbacks are safe \(i.e. cannot break the EM\) [\#85](https://github.com/ably/ably-ruby/pull/85) ([mattheworiordan](https://github.com/mattheworiordan))
88
46
 
89
47
  ## [v0.8.10](https://github.com/ably/ably-ruby/tree/v0.8.10) (2016-04-01)
48
+
90
49
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.9...v0.8.10)
91
50
 
92
51
  ## [v0.8.9](https://github.com/ably/ably-ruby/tree/v0.8.9) (2016-03-01)
52
+
93
53
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.8...v0.8.9)
94
54
 
95
55
  **Fixed bugs:**
96
56
 
97
57
  - Support enter\(data\) [\#79](https://github.com/ably/ably-ruby/issues/79)
58
+
98
59
  - Update documentation to hide private API methods [\#77](https://github.com/ably/ably-ruby/issues/77)
99
60
 
100
61
  **Closed issues:**
@@ -104,9 +65,11 @@
104
65
  **Merged pull requests:**
105
66
 
106
67
  - Various fixes for open issues [\#82](https://github.com/ably/ably-ruby/pull/82) ([mattheworiordan](https://github.com/mattheworiordan))
68
+
107
69
  - Encryption spec update [\#81](https://github.com/ably/ably-ruby/pull/81) ([mattheworiordan](https://github.com/mattheworiordan))
108
70
 
109
71
  ## [v0.8.8](https://github.com/ably/ably-ruby/tree/v0.8.8) (2016-01-26)
72
+
110
73
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.7...v0.8.8)
111
74
 
112
75
  **Closed issues:**
@@ -114,18 +77,23 @@
114
77
  - Support :key in ClientOptions and deprecate :api\_key [\#73](https://github.com/ably/ably-ruby/issues/73)
115
78
 
116
79
  ## [v0.8.7](https://github.com/ably/ably-ruby/tree/v0.8.7) (2015-12-31)
80
+
117
81
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.6...v0.8.7)
118
82
 
119
83
  ## [v0.8.6](https://github.com/ably/ably-ruby/tree/v0.8.6) (2015-12-02)
84
+
120
85
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.5...v0.8.6)
121
86
 
122
87
  **Merged pull requests:**
123
88
 
124
89
  - Some intermittent test fixes & enable tests that were blocked [\#70](https://github.com/ably/ably-ruby/pull/70) ([mattheworiordan](https://github.com/mattheworiordan))
90
+
125
91
  - Output detailed log for any text failures [\#67](https://github.com/ably/ably-ruby/pull/67) ([mattheworiordan](https://github.com/mattheworiordan))
92
+
126
93
  - 0.8 final spec \(98% compliance\) [\#66](https://github.com/ably/ably-ruby/pull/66) ([mattheworiordan](https://github.com/mattheworiordan))
127
94
 
128
95
  ## [v0.8.5](https://github.com/ably/ably-ruby/tree/v0.8.5) (2015-10-08)
96
+
129
97
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.4...v0.8.5)
130
98
 
131
99
  **Implemented enhancements:**
@@ -135,7 +103,9 @@
135
103
  **Fixed bugs:**
136
104
 
137
105
  - Switch arity of auth methods [\#61](https://github.com/ably/ably-ruby/issues/61)
106
+
138
107
  - Add test: Message published, connection dropped, then restores to point before last message was published [\#56](https://github.com/ably/ably-ruby/issues/56)
108
+
139
109
  - Documentation for constructor is incorrect [\#49](https://github.com/ably/ably-ruby/issues/49)
140
110
 
141
111
  **Merged pull requests:**
@@ -143,30 +113,41 @@
143
113
  - Ensure connections are always closed in tests [\#63](https://github.com/ably/ably-ruby/pull/63) ([mattheworiordan](https://github.com/mattheworiordan))
144
114
 
145
115
  ## [v0.8.4](https://github.com/ably/ably-ruby/tree/v0.8.4) (2015-09-08)
116
+
146
117
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.3...v0.8.4)
147
118
 
148
119
  **Implemented enhancements:**
149
120
 
150
121
  - Add compatibility support for default Crypto params [\#53](https://github.com/ably/ably-ruby/issues/53)
122
+
151
123
  - EventEmitter on connection [\#52](https://github.com/ably/ably-ruby/issues/52)
124
+
152
125
  - Add test for connectionId attribute for a message sent over REST [\#50](https://github.com/ably/ably-ruby/issues/50)
153
126
 
154
127
  **Merged pull requests:**
155
128
 
156
129
  - Spec update to fix a number of issues [\#60](https://github.com/ably/ably-ruby/pull/60) ([mattheworiordan](https://github.com/mattheworiordan))
130
+
157
131
  - Allow clientId to be provided on init if using externally created token [\#58](https://github.com/ably/ably-ruby/pull/58) ([SimonWoolf](https://github.com/SimonWoolf))
158
132
 
159
133
  ## [v0.8.3](https://github.com/ably/ably-ruby/tree/v0.8.3) (2015-08-19)
134
+
160
135
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.2...v0.8.3)
161
136
 
162
137
  **Implemented enhancements:**
163
138
 
164
139
  - Implement :queue\_messages option [\#36](https://github.com/ably/ably-ruby/issues/36)
140
+
165
141
  - Check that a non 200-299 status code for REST requests uses fallback hosts [\#35](https://github.com/ably/ably-ruby/issues/35)
142
+
166
143
  - Move stats fixtures into ably-common [\#34](https://github.com/ably/ably-ruby/issues/34)
144
+
167
145
  - Add tests for messages with no data or name fields [\#21](https://github.com/ably/ably-ruby/issues/21)
146
+
168
147
  - Namespace MsgPack as MsgPack5 because compliance is not merged in [\#12](https://github.com/ably/ably-ruby/issues/12)
148
+
169
149
  - Add test coverage for receiving messages more than once i.e. historical messages resent somehow on reconnect [\#11](https://github.com/ably/ably-ruby/issues/11)
150
+
170
151
  - Add async methods for Authentication in the realtime library [\#8](https://github.com/ably/ably-ruby/issues/8)
171
152
 
172
153
  **Fixed bugs:**
@@ -176,28 +157,37 @@
176
157
  **Closed issues:**
177
158
 
178
159
  - Scope default token params in arguments [\#55](https://github.com/ably/ably-ruby/issues/55)
160
+
179
161
  - Channel options can be reset when accessing a channel with \#get [\#46](https://github.com/ably/ably-ruby/issues/46)
180
162
 
181
163
  **Merged pull requests:**
182
164
 
183
165
  - Separate token params for auth [\#57](https://github.com/ably/ably-ruby/pull/57) ([mattheworiordan](https://github.com/mattheworiordan))
166
+
184
167
  - Ensure files are required in a consistent order [\#51](https://github.com/ably/ably-ruby/pull/51) ([SimonWoolf](https://github.com/SimonWoolf))
185
168
 
186
169
  ## [v0.8.2](https://github.com/ably/ably-ruby/tree/v0.8.2) (2015-05-20)
170
+
187
171
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.1...v0.8.2)
188
172
 
189
173
  **Implemented enhancements:**
190
174
 
191
175
  - Ensure Array object can be used in place of Hash for payload [\#44](https://github.com/ably/ably-ruby/issues/44)
176
+
192
177
  - Change connect\_automatically option to auto\_connect for consistency [\#42](https://github.com/ably/ably-ruby/issues/42)
178
+
193
179
  - Rename PaginatedResource to PaginatedResult for consistency [\#40](https://github.com/ably/ably-ruby/issues/40)
180
+
194
181
  - EventEmitter should use `emit` not `trigger` to be consistent with other libs [\#31](https://github.com/ably/ably-ruby/issues/31)
182
+
195
183
  - Add exceptions when data attribute for messages/presence is not String, Binary or JSON data [\#4](https://github.com/ably/ably-ruby/issues/4)
184
+
196
185
  - Auth Callback and Auth URL should support tokens as well as token requests [\#2](https://github.com/ably/ably-ruby/issues/2)
197
186
 
198
187
  **Closed issues:**
199
188
 
200
189
  - Realtime Presence\#get does not wait by default [\#47](https://github.com/ably/ably-ruby/issues/47)
190
+
201
191
  - No implicit attach when accessing channel.presence [\#45](https://github.com/ably/ably-ruby/issues/45)
202
192
 
203
193
  **Merged pull requests:**
@@ -205,9 +195,11 @@
205
195
  - Reject invalid payload type [\#48](https://github.com/ably/ably-ruby/pull/48) ([mattheworiordan](https://github.com/mattheworiordan))
206
196
 
207
197
  ## [v0.8.1](https://github.com/ably/ably-ruby/tree/v0.8.1) (2015-04-23)
198
+
208
199
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.0...v0.8.1)
209
200
 
210
201
  ## [v0.8.0](https://github.com/ably/ably-ruby/tree/v0.8.0) (2015-04-23)
202
+
211
203
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.6...v0.8.0)
212
204
 
213
205
  **Merged pull requests:**
@@ -215,15 +207,18 @@
215
207
  - Token naming refactor [\#29](https://github.com/ably/ably-ruby/pull/29) ([mattheworiordan](https://github.com/mattheworiordan))
216
208
 
217
209
  ## [v0.7.6](https://github.com/ably/ably-ruby/tree/v0.7.6) (2015-04-17)
210
+
218
211
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.5...v0.7.6)
219
212
 
220
213
  **Implemented enhancements:**
221
214
 
222
215
  - Rename Stat to Stats for consistency [\#32](https://github.com/ably/ably-ruby/issues/32)
216
+
223
217
  - Stats objects [\#24](https://github.com/ably/ably-ruby/issues/24)
218
+
224
219
  - Need a test to handle errors in callbacks [\#13](https://github.com/ably/ably-ruby/issues/13)
220
+
225
221
  - Allow token ID or API key in the client constructor [\#5](https://github.com/ably/ably-ruby/issues/5)
226
- - Typed stats similar to Java library + zero default for empty stats [\#25](https://github.com/ably/ably-ruby/pull/25) ([mattheworiordan](https://github.com/mattheworiordan))
227
222
 
228
223
  **Fixed bugs:**
229
224
 
@@ -236,14 +231,19 @@
236
231
  **Merged pull requests:**
237
232
 
238
233
  - Test encoded presence fixture data for \#get & \#history [\#28](https://github.com/ably/ably-ruby/pull/28) ([mattheworiordan](https://github.com/mattheworiordan))
234
+
239
235
  - Add coveralls.io coverage reporting [\#27](https://github.com/ably/ably-ruby/pull/27) ([mattheworiordan](https://github.com/mattheworiordan))
236
+
240
237
  - New paginated resource [\#26](https://github.com/ably/ably-ruby/pull/26) ([mattheworiordan](https://github.com/mattheworiordan))
241
- - History since attach [\#22](https://github.com/ably/ably-ruby/pull/22) ([mattheworiordan](https://github.com/mattheworiordan))
238
+
239
+ - Typed stats similar to Java library + zero default for empty stats [\#25](https://github.com/ably/ably-ruby/pull/25) ([mattheworiordan](https://github.com/mattheworiordan))
242
240
 
243
241
  ## [v0.7.5](https://github.com/ably/ably-ruby/tree/v0.7.5) (2015-03-21)
242
+
244
243
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.4...v0.7.5)
245
244
 
246
245
  ## [v0.7.4](https://github.com/ably/ably-ruby/tree/v0.7.4) (2015-03-21)
246
+
247
247
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.2...v0.7.4)
248
248
 
249
249
  **Merged pull requests:**
@@ -251,6 +251,7 @@
251
251
  - Presence Member Map [\#14](https://github.com/ably/ably-ruby/pull/14) ([mattheworiordan](https://github.com/mattheworiordan))
252
252
 
253
253
  ## [v0.7.2](https://github.com/ably/ably-ruby/tree/v0.7.2) (2015-02-10)
254
+
254
255
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.1...v0.7.2)
255
256
 
256
257
  **Implemented enhancements:**
@@ -260,12 +261,15 @@
260
261
  **Merged pull requests:**
261
262
 
262
263
  - Update README to include various missing snippets for core features [\#9](https://github.com/ably/ably-ruby/pull/9) ([kouno](https://github.com/kouno))
264
+
263
265
  - Fix connection retry frequency [\#7](https://github.com/ably/ably-ruby/pull/7) ([kouno](https://github.com/kouno))
264
266
 
265
267
  ## [v0.7.1](https://github.com/ably/ably-ruby/tree/v0.7.1) (2015-01-18)
268
+
266
269
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.0...v0.7.1)
267
270
 
268
271
  ## [v0.7.0](https://github.com/ably/ably-ruby/tree/v0.7.0) (2015-01-12)
272
+
269
273
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.6.2...v0.7.0)
270
274
 
271
275
  **Closed issues:**
@@ -273,30 +277,39 @@
273
277
  - JSON encoder should only append utf-8 before a cipher encoder is applied [\#1](https://github.com/ably/ably-ruby/issues/1)
274
278
 
275
279
  ## [v0.6.2](https://github.com/ably/ably-ruby/tree/v0.6.2) (2014-12-10)
280
+
276
281
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.2.0...v0.6.2)
277
282
 
278
283
  ## [v0.2.0](https://github.com/ably/ably-ruby/tree/v0.2.0) (2014-12-09)
284
+
279
285
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.6...v0.2.0)
280
286
 
281
287
  ## [v0.1.6](https://github.com/ably/ably-ruby/tree/v0.1.6) (2014-10-31)
288
+
282
289
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.5...v0.1.6)
283
290
 
284
291
  ## [v0.1.5](https://github.com/ably/ably-ruby/tree/v0.1.5) (2014-10-23)
292
+
285
293
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.4...v0.1.5)
286
294
 
287
295
  ## [v0.1.4](https://github.com/ably/ably-ruby/tree/v0.1.4) (2014-09-27)
296
+
288
297
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.3...v0.1.4)
289
298
 
290
299
  ## [v0.1.3](https://github.com/ably/ably-ruby/tree/v0.1.3) (2014-09-26)
300
+
291
301
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.2...v0.1.3)
292
302
 
293
303
  ## [v0.1.2](https://github.com/ably/ably-ruby/tree/v0.1.2) (2014-09-25)
304
+
294
305
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.1...v0.1.2)
295
306
 
296
307
  ## [v0.1.1](https://github.com/ably/ably-ruby/tree/v0.1.1) (2014-09-23)
308
+
297
309
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.0...v0.1.1)
298
310
 
299
311
  ## [v0.1.0](https://github.com/ably/ably-ruby/tree/v0.1.0) (2014-09-23)
300
312
 
301
313
 
314
+
302
315
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
@@ -24,12 +24,6 @@ And then install this Bundler dependency:
24
24
  Or install it yourself as:
25
25
 
26
26
  $ gem install ably
27
-
28
- ### Using with Rails or Sinatra
29
-
30
- This `ably` gem provides both a [Realtime](http://www.ably.io/documentation/realtime/usage) and [REST](http://www.ably.io/documentation/rest/usage) version of the Ably library. Realtime depends on EventMachine to provide an asynchronous evented framework to run the library in, whereas the REST library depends only on synchronous libraries such as Faraday.
31
-
32
- If you are using Ably within your Rails or Sinatra apps, more often than not, you probably want to use the REST only version of the library that has no dependency on EventMachine and provides a synchronous API that you will be used to using within Rails and Sinatra. [See the REST only Ruby version of the Ably library](https://github.com/ably/ably-ruby-rest).
33
27
 
34
28
  ## Using the Realtime API
35
29
 
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rspec', '~> 3.2.0' # version lock, see config.around(:example, :event_machine) in event_machine_helper.rb
38
38
  spec.add_development_dependency 'rspec-retry'
39
39
  spec.add_development_dependency 'yard'
40
- spec.add_development_dependency 'webmock', '~> 2.3.0'
40
+ spec.add_development_dependency 'webmock'
41
41
 
42
42
  spec.add_development_dependency 'coveralls'
43
43
 
@@ -65,8 +65,6 @@ module Ably
65
65
  @token_params = token_params.dup
66
66
  @token_option = options[:token] || options[:token_details]
67
67
 
68
- @options.delete :force # Forcing token auth for every request is not a valid default
69
-
70
68
  if options[:key] && (options[:key_secret] || options[:key_name])
71
69
  raise ArgumentError, 'key and key_name or key_secret are mutually exclusive. Provider either a key or key_name & key_secret'
72
70
  end
@@ -88,11 +86,11 @@ module Ably
88
86
  end
89
87
 
90
88
  # If a token details object or token string is provided in the initializer
91
- # then the client can be authorised immediately using this token
89
+ # then the client can be authorized immediately using this token
92
90
  if token_option
93
91
  token_details = convert_to_token_details(token_option)
94
92
  if token_details
95
- token_details = authorise_with_token(token_details)
93
+ token_details = authorize_with_token(token_details)
96
94
  logger.debug "Auth: new token passed in to the initializer: #{token_details}"
97
95
  end
98
96
  end
@@ -107,7 +105,6 @@ module Ably
107
105
  #
108
106
  # @param [Hash, nil] token_params the token params used for future token requests. When nil, previously configured token params are used
109
107
  # @param [Hash, nil] auth_options the authentication options used for future token requests. When nil, previously configure authentication options are used
110
- # @option auth_options [Boolean] :force obtains a new token even if the current token is valid. If the provided +auth_options+ Hash contains only this +:force+ attribute, the existing configured authentication options are not overwriten
111
108
  # @option (see #request_token)
112
109
  #
113
110
  # @return (see #create_token_request)
@@ -115,19 +112,17 @@ module Ably
115
112
  # @example
116
113
  # # will issue a simple token request using basic auth
117
114
  # client = Ably::Rest::Client.new(key: 'key.id:secret')
118
- # token_details = client.auth.authorise
115
+ # token_details = client.auth.authorize
119
116
  #
120
- # # will use token request from block to authorise if not already authorised
121
- # token_details = client.auth.authorise {}, auth_callback: Proc.new do
117
+ # # will use token request from block to authorize if not already authorized
118
+ # token_details = client.auth.authorize {}, auth_callback: Proc.new do
122
119
  # # create token_request object
123
120
  # token_request
124
121
  # end
125
122
  #
126
- def authorise(token_params = nil, auth_options = nil)
127
- if auth_options == { force: true }
128
- auth_options = options.merge(force: true)
129
- elsif auth_options.nil?
130
- auth_options = options
123
+ def authorize(token_params = nil, auth_options = nil)
124
+ if auth_options.nil?
125
+ auth_options = options # Use default options
131
126
  else
132
127
  ensure_valid_auth_attributes auth_options
133
128
 
@@ -146,34 +141,35 @@ module Ably
146
141
 
147
142
  @options = auth_options.clone
148
143
 
149
- # Force reauth and query the server time only happens once
150
- # the otpions remain in auth_options though so they are passed to request_token
144
+ # Query the server time only happens once
145
+ # the options remain in auth_options though so they are passed to request_token
151
146
  @options.delete(:query_time)
152
- @options.delete(:force)
153
147
 
154
148
  @options.freeze
155
149
  end
156
150
 
151
+ # Unless provided, defaults are used
157
152
  unless token_params.nil?
158
153
  @token_params = token_params
159
154
  @token_params.freeze
160
155
  end
161
156
 
162
- if current_token_details && !auth_options[:force]
163
- return current_token_details unless current_token_details.expired?
164
- end
165
-
166
- authorise_with_token(request_token(@token_params, auth_options)).tap do |new_token_details|
157
+ authorize_with_token(request_token(@token_params, auth_options)).tap do |new_token_details|
167
158
  logger.debug "Auth: new token following authorisation: #{new_token_details}"
168
159
 
169
- # If authorise was forced allow a block to be called so that the realtime library
170
- # can force upgrade the authorisation
171
- if auth_options[:force] && block_given?
160
+ # If authorize the realtime library required auth, then yield the token in a block
161
+ if block_given?
172
162
  yield new_token_details
173
163
  end
174
164
  end
175
165
  end
176
166
 
167
+ # @deprecated Use {#authorize} instead
168
+ def authorise(*args, &block)
169
+ logger.warn "Auth#authorise is deprecated and will be removed in 1.0. Please use Auth#authorize instead"
170
+ authorize(*args, &block)
171
+ end
172
+
177
173
  # Request a {Ably::Models::TokenDetails} which can be used to make authenticated token based requests
178
174
  #
179
175
  # @param [Hash] auth_options (see #create_token_request)
@@ -347,7 +343,7 @@ module Ably
347
343
  end
348
344
 
349
345
  # Auth header string used in HTTP requests to Ably
350
- # Will reauthorise implicitly if required and capable
346
+ # Will reauthorize implicitly if required and capable
351
347
  #
352
348
  # @return [String] HTTP authentication value used in HTTP_AUTHORIZATION header
353
349
  def auth_header
@@ -359,7 +355,7 @@ module Ably
359
355
  end
360
356
 
361
357
  # Auth params used in URI endpoint for Realtime connections
362
- # Will reauthorise implicitly if required and capable
358
+ # Will reauthorize implicitly if required and capable
363
359
  #
364
360
  # @return [Hash] Auth params for a new Realtime connection
365
361
  def auth_params
@@ -449,6 +445,14 @@ module Ably
449
445
  @token_option
450
446
  end
451
447
 
448
+ def authorize_when_necessary
449
+ if current_token_details && !current_token_details.expired?
450
+ return current_token_details
451
+ else
452
+ authorize
453
+ end
454
+ end
455
+
452
456
  # Returns the current device clock time unless the
453
457
  # the server time has previously been requested with query_time: true
454
458
  # and the @server_time_offset is configured
@@ -530,16 +534,17 @@ module Ably
530
534
  @key_secret = options.delete(:key_secret)
531
535
  end
532
536
 
533
- # Returns the current token if it exists or authorises and retrieves a token
537
+ # Returns the current token if it exists or authorizes and retrieves a token
534
538
  def token_auth_string
535
539
  if !current_token_details && token_option
540
+ logger.debug "Auth: Token auth string missing, authorizing implicitly now"
536
541
  # A TokenRequest was configured in the ClientOptions +:token field+ and no current token exists
537
542
  # Note: If a Token or TokenDetails is provided in the initializer, the token is stored in +current_token_details+
538
- authorise_with_token send_token_request(token_option)
543
+ authorize_with_token send_token_request(token_option)
539
544
  current_token_details.token
540
545
  else
541
- # Authorise will use the current token if one exists and is not expired, otherwise a new token will be issued
542
- authorise.token
546
+ # Authorize will use the current token if one exists and is not expired, otherwise a new token will be issued
547
+ authorize_when_necessary.token
543
548
  end
544
549
  end
545
550
 
@@ -615,7 +620,7 @@ module Ably
615
620
  end
616
621
 
617
622
  # Use the provided token to authenticate immediately and store the token details in +current_token_details+
618
- def authorise_with_token(new_token_details)
623
+ def authorize_with_token(new_token_details)
619
624
  if new_token_details && !new_token_details.from_token_string?
620
625
  if !token_client_id_allowed?(new_token_details.client_id)
621
626
  raise Ably::Exceptions::IncompatibleClientId.new("Client ID '#{new_token_details.client_id}' in the token is incompatible with the current client ID '#{client_id}'", 400, 40012)
@@ -645,7 +650,7 @@ module Ably
645
650
 
646
651
  response = client.post("/keys/#{token_request.key_name}/requestToken",
647
652
  token_request.attributes, send_auth_header: false,
648
- disable_automatic_reauthorise: true)
653
+ disable_automatic_reauthorize: true)
649
654
 
650
655
  Ably::Models::TokenDetails.new(response.body)
651
656
  end