ably 0.8.5 → 0.8.6

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +42 -48
  4. data/SPEC.md +1099 -640
  5. data/ably.gemspec +10 -4
  6. data/lib/ably/auth.rb +155 -47
  7. data/lib/ably/exceptions.rb +2 -0
  8. data/lib/ably/models/channel_state_change.rb +2 -3
  9. data/lib/ably/models/connection_details.rb +54 -0
  10. data/lib/ably/models/protocol_message.rb +14 -4
  11. data/lib/ably/models/token_details.rb +13 -7
  12. data/lib/ably/models/token_request.rb +1 -2
  13. data/lib/ably/modules/ably.rb +3 -2
  14. data/lib/ably/modules/message_emitter.rb +1 -3
  15. data/lib/ably/modules/state_emitter.rb +2 -2
  16. data/lib/ably/realtime/auth.rb +6 -0
  17. data/lib/ably/realtime/channel/channel_manager.rb +2 -0
  18. data/lib/ably/realtime/channel.rb +15 -4
  19. data/lib/ably/realtime/client/incoming_message_dispatcher.rb +11 -1
  20. data/lib/ably/realtime/client.rb +10 -3
  21. data/lib/ably/realtime/connection/connection_manager.rb +58 -54
  22. data/lib/ably/realtime/connection.rb +62 -6
  23. data/lib/ably/realtime/presence.rb +18 -5
  24. data/lib/ably/rest/channel.rb +9 -1
  25. data/lib/ably/rest/client.rb +32 -14
  26. data/lib/ably/rest/presence.rb +1 -1
  27. data/lib/ably/version.rb +1 -1
  28. data/lib/ably.rb +2 -0
  29. data/spec/acceptance/realtime/auth_spec.rb +251 -11
  30. data/spec/acceptance/realtime/channel_history_spec.rb +12 -2
  31. data/spec/acceptance/realtime/channel_spec.rb +316 -24
  32. data/spec/acceptance/realtime/client_spec.rb +93 -1
  33. data/spec/acceptance/realtime/connection_failures_spec.rb +177 -86
  34. data/spec/acceptance/realtime/connection_spec.rb +284 -60
  35. data/spec/acceptance/realtime/message_spec.rb +45 -6
  36. data/spec/acceptance/realtime/presence_history_spec.rb +4 -0
  37. data/spec/acceptance/realtime/presence_spec.rb +181 -49
  38. data/spec/acceptance/realtime/time_spec.rb +13 -0
  39. data/spec/acceptance/rest/auth_spec.rb +222 -4
  40. data/spec/acceptance/rest/channel_spec.rb +132 -1
  41. data/spec/acceptance/rest/client_spec.rb +129 -28
  42. data/spec/acceptance/rest/presence_spec.rb +7 -7
  43. data/spec/acceptance/rest/time_spec.rb +10 -0
  44. data/spec/shared/client_initializer_behaviour.rb +41 -17
  45. data/spec/spec_helper.rb +1 -0
  46. data/spec/support/debug_failure_helper.rb +16 -0
  47. data/spec/unit/models/connection_details_spec.rb +60 -0
  48. data/spec/unit/models/protocol_message_spec.rb +45 -0
  49. data/spec/unit/modules/event_emitter_spec.rb +3 -1
  50. data/spec/unit/realtime/channel_spec.rb +6 -5
  51. data/spec/unit/realtime/client_spec.rb +5 -1
  52. data/spec/unit/realtime/connection_spec.rb +5 -1
  53. data/spec/unit/realtime/realtime_spec.rb +5 -1
  54. metadata +54 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deb69100f880e16767da5cad8178d7ed8ec8202a
4
- data.tar.gz: f9c6e5b632f1992657178b118c80e4b828de051c
3
+ metadata.gz: 6a4aa78138ad01b46a950d1847451435ccf2153f
4
+ data.tar.gz: ae44d35bb6032db57db14bf55da757195dc4d1c4
5
5
  SHA512:
6
- metadata.gz: d725527fdd9e8c517233bebdc87f3bd8775234c1cbf9f44a8ff7ce8c28de744fe4037f67fbdae26caae83428c7785116056f4289c60c342d9b7df7a533913b07
7
- data.tar.gz: d2b8f496227bf4122e167426380213de6473f89c02385eadabd82d268fbe01b347fd9cf9b973f1dbce86b2b2e8beab0670221d8657367cef1ada68783367673e
6
+ metadata.gz: 582fe45057b76491d607dd7d1159188aa841f5852dd866e11feb5f1a7c4cacf81c8829b8b5d54e7f4b0ff29442c147d898f2b53ba24cd1f0b95911c9722f856a
7
+ data.tar.gz: b925e5a0ea33b3ae2fc5e01b635f59c099b56f807e6007ada49fcc671aa6e2e48353e07b2d2a9db9ca97925eec4eb5ef4178f9c80458b4e76f413f6d7227b854
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  sudo: false
2
- env: RSPEC_RETRY=true
2
+ env: RSPEC_RETRY=false
3
3
  language: ruby
4
4
  rvm:
5
5
  - 1.9.3
data/CHANGELOG.md CHANGED
@@ -1,29 +1,59 @@
1
1
  # Change Log
2
2
 
3
- ## [Unreleased](https://github.com/ably/ably-ruby/tree/HEAD)
3
+ ## [v0.8.6](https://github.com/ably/ably-ruby/tree/v0.8.6) (2015-12-02)
4
4
 
5
- [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.2...HEAD)
5
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.5...v0.8.6)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Some intermittent test fixes & enable tests that were blocked [\#70](https://github.com/ably/ably-ruby/pull/70) ([mattheworiordan](https://github.com/mattheworiordan))
10
+
11
+ - Output detailed log for any text failures [\#67](https://github.com/ably/ably-ruby/pull/67) ([mattheworiordan](https://github.com/mattheworiordan))
12
+
13
+ - 0.8 final spec \(98% compliance\) [\#66](https://github.com/ably/ably-ruby/pull/66) ([mattheworiordan](https://github.com/mattheworiordan))
14
+
15
+ ## [v0.8.5](https://github.com/ably/ably-ruby/tree/v0.8.5) (2015-10-08)
16
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.4...v0.8.5)
6
17
 
7
18
  **Implemented enhancements:**
8
19
 
9
- - Add compatibility support for default Crypto params [\#53](https://github.com/ably/ably-ruby/issues/53)
20
+ - Switch arity of auth methods [\#61](https://github.com/ably/ably-ruby/issues/61)
10
21
 
11
- - EventEmitter on connection [\#52](https://github.com/ably/ably-ruby/issues/52)
22
+ **Fixed bugs:**
12
23
 
24
+ - Switch arity of auth methods [\#61](https://github.com/ably/ably-ruby/issues/61)
25
+ - Add test: Message published, connection dropped, then restores to point before last message was published [\#56](https://github.com/ably/ably-ruby/issues/56)
26
+ - Documentation for constructor is incorrect [\#49](https://github.com/ably/ably-ruby/issues/49)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Ensure connections are always closed in tests [\#63](https://github.com/ably/ably-ruby/pull/63) ([mattheworiordan](https://github.com/mattheworiordan))
31
+
32
+ ## [v0.8.4](https://github.com/ably/ably-ruby/tree/v0.8.4) (2015-09-08)
33
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.3...v0.8.4)
34
+
35
+ **Implemented enhancements:**
36
+
37
+ - Add compatibility support for default Crypto params [\#53](https://github.com/ably/ably-ruby/issues/53)
38
+ - EventEmitter on connection [\#52](https://github.com/ably/ably-ruby/issues/52)
13
39
  - Add test for connectionId attribute for a message sent over REST [\#50](https://github.com/ably/ably-ruby/issues/50)
14
40
 
15
- - Implement :queue\_messages option [\#36](https://github.com/ably/ably-ruby/issues/36)
41
+ **Merged pull requests:**
16
42
 
17
- - Check that a non 200-299 status code for REST requests uses fallback hosts [\#35](https://github.com/ably/ably-ruby/issues/35)
43
+ - Spec update to fix a number of issues [\#60](https://github.com/ably/ably-ruby/pull/60) ([mattheworiordan](https://github.com/mattheworiordan))
44
+ - 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))
18
45
 
19
- - Move stats fixtures into ably-common [\#34](https://github.com/ably/ably-ruby/issues/34)
46
+ ## [v0.8.3](https://github.com/ably/ably-ruby/tree/v0.8.3) (2015-08-19)
47
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.2...v0.8.3)
20
48
 
21
- - Add tests for messages with no data or name fields [\#21](https://github.com/ably/ably-ruby/issues/21)
49
+ **Implemented enhancements:**
22
50
 
51
+ - Implement :queue\_messages option [\#36](https://github.com/ably/ably-ruby/issues/36)
52
+ - Check that a non 200-299 status code for REST requests uses fallback hosts [\#35](https://github.com/ably/ably-ruby/issues/35)
53
+ - Move stats fixtures into ably-common [\#34](https://github.com/ably/ably-ruby/issues/34)
54
+ - Add tests for messages with no data or name fields [\#21](https://github.com/ably/ably-ruby/issues/21)
23
55
  - Namespace MsgPack as MsgPack5 because compliance is not merged in [\#12](https://github.com/ably/ably-ruby/issues/12)
24
-
25
56
  - 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)
26
-
27
57
  - Add async methods for Authentication in the realtime library [\#8](https://github.com/ably/ably-ruby/issues/8)
28
58
 
29
59
  **Fixed bugs:**
@@ -33,41 +63,28 @@
33
63
  **Closed issues:**
34
64
 
35
65
  - Scope default token params in arguments [\#55](https://github.com/ably/ably-ruby/issues/55)
36
-
37
66
  - Channel options can be reset when accessing a channel with \#get [\#46](https://github.com/ably/ably-ruby/issues/46)
38
67
 
39
68
  **Merged pull requests:**
40
69
 
41
- - Spec update to fix a number of issues [\#60](https://github.com/ably/ably-ruby/pull/60) ([mattheworiordan](https://github.com/mattheworiordan))
42
-
43
- - 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))
44
-
45
70
  - Separate token params for auth [\#57](https://github.com/ably/ably-ruby/pull/57) ([mattheworiordan](https://github.com/mattheworiordan))
46
-
47
71
  - Ensure files are required in a consistent order [\#51](https://github.com/ably/ably-ruby/pull/51) ([SimonWoolf](https://github.com/SimonWoolf))
48
72
 
49
73
  ## [v0.8.2](https://github.com/ably/ably-ruby/tree/v0.8.2) (2015-05-20)
50
-
51
74
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.1...v0.8.2)
52
75
 
53
76
  **Implemented enhancements:**
54
77
 
55
78
  - Ensure Array object can be used in place of Hash for payload [\#44](https://github.com/ably/ably-ruby/issues/44)
56
-
57
79
  - Change connect\_automatically option to auto\_connect for consistency [\#42](https://github.com/ably/ably-ruby/issues/42)
58
-
59
80
  - Rename PaginatedResource to PaginatedResult for consistency [\#40](https://github.com/ably/ably-ruby/issues/40)
60
-
61
81
  - EventEmitter should use `emit` not `trigger` to be consistent with other libs [\#31](https://github.com/ably/ably-ruby/issues/31)
62
-
63
82
  - Add exceptions when data attribute for messages/presence is not String, Binary or JSON data [\#4](https://github.com/ably/ably-ruby/issues/4)
64
-
65
83
  - Auth Callback and Auth URL should support tokens as well as token requests [\#2](https://github.com/ably/ably-ruby/issues/2)
66
84
 
67
85
  **Closed issues:**
68
86
 
69
87
  - Realtime Presence\#get does not wait by default [\#47](https://github.com/ably/ably-ruby/issues/47)
70
-
71
88
  - No implicit attach when accessing channel.presence [\#45](https://github.com/ably/ably-ruby/issues/45)
72
89
 
73
90
  **Merged pull requests:**
@@ -75,11 +92,9 @@
75
92
  - Reject invalid payload type [\#48](https://github.com/ably/ably-ruby/pull/48) ([mattheworiordan](https://github.com/mattheworiordan))
76
93
 
77
94
  ## [v0.8.1](https://github.com/ably/ably-ruby/tree/v0.8.1) (2015-04-23)
78
-
79
95
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.0...v0.8.1)
80
96
 
81
97
  ## [v0.8.0](https://github.com/ably/ably-ruby/tree/v0.8.0) (2015-04-23)
82
-
83
98
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.6...v0.8.0)
84
99
 
85
100
  **Merged pull requests:**
@@ -87,18 +102,15 @@
87
102
  - Token naming refactor [\#29](https://github.com/ably/ably-ruby/pull/29) ([mattheworiordan](https://github.com/mattheworiordan))
88
103
 
89
104
  ## [v0.7.6](https://github.com/ably/ably-ruby/tree/v0.7.6) (2015-04-17)
90
-
91
105
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.5...v0.7.6)
92
106
 
93
107
  **Implemented enhancements:**
94
108
 
95
109
  - Rename Stat to Stats for consistency [\#32](https://github.com/ably/ably-ruby/issues/32)
96
-
97
110
  - Stats objects [\#24](https://github.com/ably/ably-ruby/issues/24)
98
-
99
111
  - Need a test to handle errors in callbacks [\#13](https://github.com/ably/ably-ruby/issues/13)
100
-
101
112
  - Allow token ID or API key in the client constructor [\#5](https://github.com/ably/ably-ruby/issues/5)
113
+ - 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))
102
114
 
103
115
  **Fixed bugs:**
104
116
 
@@ -111,19 +123,14 @@
111
123
  **Merged pull requests:**
112
124
 
113
125
  - Test encoded presence fixture data for \#get & \#history [\#28](https://github.com/ably/ably-ruby/pull/28) ([mattheworiordan](https://github.com/mattheworiordan))
114
-
115
126
  - Add coveralls.io coverage reporting [\#27](https://github.com/ably/ably-ruby/pull/27) ([mattheworiordan](https://github.com/mattheworiordan))
116
-
117
127
  - New paginated resource [\#26](https://github.com/ably/ably-ruby/pull/26) ([mattheworiordan](https://github.com/mattheworiordan))
118
-
119
- - 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))
128
+ - History since attach [\#22](https://github.com/ably/ably-ruby/pull/22) ([mattheworiordan](https://github.com/mattheworiordan))
120
129
 
121
130
  ## [v0.7.5](https://github.com/ably/ably-ruby/tree/v0.7.5) (2015-03-21)
122
-
123
131
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.4...v0.7.5)
124
132
 
125
133
  ## [v0.7.4](https://github.com/ably/ably-ruby/tree/v0.7.4) (2015-03-21)
126
-
127
134
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.2...v0.7.4)
128
135
 
129
136
  **Merged pull requests:**
@@ -131,7 +138,6 @@
131
138
  - Presence Member Map [\#14](https://github.com/ably/ably-ruby/pull/14) ([mattheworiordan](https://github.com/mattheworiordan))
132
139
 
133
140
  ## [v0.7.2](https://github.com/ably/ably-ruby/tree/v0.7.2) (2015-02-10)
134
-
135
141
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.1...v0.7.2)
136
142
 
137
143
  **Implemented enhancements:**
@@ -141,15 +147,12 @@
141
147
  **Merged pull requests:**
142
148
 
143
149
  - Update README to include various missing snippets for core features [\#9](https://github.com/ably/ably-ruby/pull/9) ([kouno](https://github.com/kouno))
144
-
145
150
  - Fix connection retry frequency [\#7](https://github.com/ably/ably-ruby/pull/7) ([kouno](https://github.com/kouno))
146
151
 
147
152
  ## [v0.7.1](https://github.com/ably/ably-ruby/tree/v0.7.1) (2015-01-18)
148
-
149
153
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.7.0...v0.7.1)
150
154
 
151
155
  ## [v0.7.0](https://github.com/ably/ably-ruby/tree/v0.7.0) (2015-01-12)
152
-
153
156
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.6.2...v0.7.0)
154
157
 
155
158
  **Closed issues:**
@@ -157,39 +160,30 @@
157
160
  - JSON encoder should only append utf-8 before a cipher encoder is applied [\#1](https://github.com/ably/ably-ruby/issues/1)
158
161
 
159
162
  ## [v0.6.2](https://github.com/ably/ably-ruby/tree/v0.6.2) (2014-12-10)
160
-
161
163
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.2.0...v0.6.2)
162
164
 
163
165
  ## [v0.2.0](https://github.com/ably/ably-ruby/tree/v0.2.0) (2014-12-09)
164
-
165
166
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.6...v0.2.0)
166
167
 
167
168
  ## [v0.1.6](https://github.com/ably/ably-ruby/tree/v0.1.6) (2014-10-31)
168
-
169
169
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.5...v0.1.6)
170
170
 
171
171
  ## [v0.1.5](https://github.com/ably/ably-ruby/tree/v0.1.5) (2014-10-23)
172
-
173
172
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.4...v0.1.5)
174
173
 
175
174
  ## [v0.1.4](https://github.com/ably/ably-ruby/tree/v0.1.4) (2014-09-27)
176
-
177
175
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.3...v0.1.4)
178
176
 
179
177
  ## [v0.1.3](https://github.com/ably/ably-ruby/tree/v0.1.3) (2014-09-26)
180
-
181
178
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.2...v0.1.3)
182
179
 
183
180
  ## [v0.1.2](https://github.com/ably/ably-ruby/tree/v0.1.2) (2014-09-25)
184
-
185
181
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.1...v0.1.2)
186
182
 
187
183
  ## [v0.1.1](https://github.com/ably/ably-ruby/tree/v0.1.1) (2014-09-23)
188
-
189
184
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.1.0...v0.1.1)
190
185
 
191
186
  ## [v0.1.0](https://github.com/ably/ably-ruby/tree/v0.1.0) (2014-09-23)
192
187
 
193
188
 
194
-
195
189
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*