ably 0.8.9 → 0.8.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cd4a525c4afb786a1994c05d636351ad5440585
4
- data.tar.gz: eed7ec593d7bfeb68d5b7663bd438549d30f8c9a
3
+ metadata.gz: ebdb3de0d61032d4177a8fe51975ac1967e7fe9e
4
+ data.tar.gz: 5cdaef2668a7e4fd9eac0027115bac896c8438f7
5
5
  SHA512:
6
- metadata.gz: b530e68c8e7f13cadd783e43061d1f52230aa60e7744714635e9c097753ef84ce9491016a1fa2ee9718c587a0f8d5a8cec4b554b85b646291d8e04a7f434fea0
7
- data.tar.gz: 1a6fc49f90ce35216ba8290acad13e80f7d4b62f5a88d8658b11bed27261708b290a2bf509b079c78f3fc1858d502f9c05a187bd2006def26c43519779280ab4
6
+ metadata.gz: 4aa4df9755c680ddb24e927bfd82fcce0cb8909bad91b8d91e367a1d14b14ff3accc83dd4c668e4dec0a734be9ef82e56c8eb31f2d20f6b71bec8432ca1082ab
7
+ data.tar.gz: 8dc667ac95090f550e9606fac468f89f4029979955967da6aba5b31ded8ac7a3d3be24c40b6f2074a519ff8aae52e038bb5d983c5cc11b2122ccadd43267482f
@@ -1,8 +1,16 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.8.4](https://github.com/ably/ably-ruby/tree/v0.8.9) (2015-03-01)
3
+ ## [v0.8.9](https://github.com/ably/ably-ruby/tree/v0.8.9) (2016-04-01)
4
4
 
5
- [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.7...v0.8.9)
5
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.9...v0.8.10)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - API keys have hyphens
10
+
11
+ ## [v0.8.9](https://github.com/ably/ably-ruby/tree/v0.8.9) (2016-03-01)
12
+
13
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.8...v0.8.9)
6
14
 
7
15
  **Fixed bugs:**
8
16
 
@@ -14,14 +22,20 @@
14
22
 
15
23
  - New Crypto Spec [\#80](https://github.com/ably/ably-ruby/issues/80)
16
24
 
17
- - Support :key in ClientOptions and deprecate :api\_key [\#73](https://github.com/ably/ably-ruby/issues/73)
18
-
19
25
  **Merged pull requests:**
20
26
 
21
27
  - Various fixes for open issues [\#82](https://github.com/ably/ably-ruby/pull/82) ([mattheworiordan](https://github.com/mattheworiordan))
22
28
 
23
29
  - Encryption spec update [\#81](https://github.com/ably/ably-ruby/pull/81) ([mattheworiordan](https://github.com/mattheworiordan))
24
30
 
31
+ ## [v0.8.8](https://github.com/ably/ably-ruby/tree/v0.8.8) (2016-01-26)
32
+
33
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.7...v0.8.8)
34
+
35
+ **Closed issues:**
36
+
37
+ - Support :key in ClientOptions and deprecate :api\_key [\#73](https://github.com/ably/ably-ruby/issues/73)
38
+
25
39
  ## [v0.8.7](https://github.com/ably/ably-ruby/tree/v0.8.7) (2015-12-31)
26
40
 
27
41
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.6...v0.8.7)
data/README.md CHANGED
@@ -227,10 +227,10 @@ secret_key = Ably::Util::Crypto.generate_random_key
227
227
  channel = client.channels.get('test', cipher: { key: secret_key })
228
228
  channel.publish nil, "sensitive data" # data will be encrypted before publish
229
229
  messages_page = channel.history
230
- messages_page.first.data #=> "sensitive data"
230
+ messages_page.items.first.data #=> "sensitive data"
231
231
  ```
232
232
 
233
- ### Generate Token
233
+ ### Generate a Token
234
234
 
235
235
  Tokens are issued by Ably and are readily usable by any client to connect to Ably:
236
236
 
@@ -120,7 +120,7 @@ module Ably
120
120
 
121
121
  options = options.clone
122
122
  if options.kind_of?(String)
123
- options = if options.match(/^[\w]{2,}\.[\w]{2,}:[\w]{2,}$/)
123
+ options = if options.match(/^[\w-]{2,}\.[\w-]{2,}:[\w-]{2,}$/)
124
124
  { key: options }
125
125
  else
126
126
  { token: options }
@@ -1,3 +1,3 @@
1
1
  module Ably
2
- VERSION = '0.8.9'
2
+ VERSION = '0.8.10'
3
3
  end
@@ -106,18 +106,18 @@ shared_examples 'a client initializer' do
106
106
  allow_any_instance_of(subject.class).to receive(:auto_connect).and_return(false)
107
107
  end
108
108
 
109
- let(:client_options) { 'app.key:secret' }
109
+ let(:client_options) { 'App.k3y:sec-r3t' }
110
110
 
111
111
  it 'sets the key' do
112
112
  expect(subject.auth.key).to eql(client_options)
113
113
  end
114
114
 
115
115
  it 'sets the key_name' do
116
- expect(subject.auth.key_name).to eql('app.key')
116
+ expect(subject.auth.key_name).to eql('App.k3y')
117
117
  end
118
118
 
119
119
  it 'sets the key_secret' do
120
- expect(subject.auth.key_secret).to eql('secret')
120
+ expect(subject.auth.key_secret).to eql('sec-r3t')
121
121
  end
122
122
 
123
123
  it 'uses basic auth' do
@@ -118,4 +118,32 @@ describe Ably::Models::TokenDetails do
118
118
  end
119
119
  end
120
120
  end
121
+
122
+ context 'to_json' do
123
+ let(:token_json_parsed) { JSON.parse(Ably::Models::TokenDetails(token_attributes).to_json) }
124
+
125
+ context 'with all attributes and values' do
126
+ let(:token_attributes) do
127
+ { token: random_str, capability: random_str, keyName: random_str, issued: Time.now.to_i, expires: Time.now.to_i + 10, clientId: random_str }
128
+ end
129
+
130
+ it 'returns all attributes' do
131
+ token_attributes.each do |key, val|
132
+ expect(token_json_parsed[key.to_s]).to eql(val)
133
+ end
134
+ expect(token_attributes.keys.length).to eql(token_json_parsed.keys.length)
135
+ end
136
+ end
137
+
138
+ context 'with only a token string' do
139
+ let(:token_attributes) do
140
+ { token: random_str }
141
+ end
142
+
143
+ it 'returns populated attributes' do
144
+ expect(token_json_parsed['token']).to eql(token_attributes[:token])
145
+ expect(token_json_parsed.keys.length).to eql(1)
146
+ end
147
+ end
148
+ end
121
149
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ably
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lewis Marshall
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-01 00:00:00.000000000 Z
12
+ date: 2016-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine