deepstream 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 27521eb9ef36bc18d1fe6a152a72b434f4f88cfd
4
- data.tar.gz: eb40eca01f6c60b97334831ac3615ec9795c3888
3
+ metadata.gz: 415afac1b1b07ec3f6a7fce9e0c1909e44d65cd1
4
+ data.tar.gz: c50cc950cfab3fe1efc239ca7605e1e2540a1831
5
5
  SHA512:
6
- metadata.gz: d23e50627674027fc34eaeb08935eb723fdb5152f3bfdaf3f2082c17be15361fffb26463eb1438f47610f1f64dc5755aae55e4678979683842ff571fb3f5a206
7
- data.tar.gz: aa5d2e0b062f15130a372a6a23fb3dc3dd285e660cfed7a76cadcd4d4e5da94fb2378bd030e64de71aad0176b37d457faf658c31975635ac3e694fe5b5ebac2a
6
+ metadata.gz: 6353455636f5e9c28dbcb5e4b39ba7b054a88cf8f34a52ad4344d0a74b2fd587199c2f059bef82702009c004be812ff9f0149ae4a20cc9d9d446ddfde0bcaad8
7
+ data.tar.gz: dea8bc0022447c85fd444294062c0d0c561fe45e296ae5e1d5eade6b44eae4b62b0d32d6c6a0d2137effe905a8f70b0ed1377d914051f8eb58da62ce8dfeb6cf
data/README.md CHANGED
@@ -2,13 +2,18 @@
2
2
  deepstream.io ruby client
3
3
 
4
4
 
5
- ### Usage
5
+ ### Install
6
+
7
+ ```
8
+ gem install deepstream
9
+ ```
10
+
6
11
 
12
+ ### Usage
7
13
  ```ruby
8
14
  ds = Deepstream::Client.new('localhost')
9
15
 
10
16
  # Emit events
11
-
12
17
  ds.emit 'my_event'
13
18
  # or
14
19
  ds.emit 'my_event', foo: 'bar', bar: 'foo'
@@ -20,7 +25,7 @@ ds.on('some_event') do |msg|
20
25
  end
21
26
 
22
27
 
23
- # Get records
28
+ # Get a record
24
29
  foo = ds.get('foo')
25
30
 
26
31
  # Update record
@@ -28,7 +33,5 @@ foo.bar = 'bar'
28
33
  # or
29
34
  foo.set('bar', 'bar')
30
35
 
31
- # Set whole record
36
+ # Set the whole record
32
37
  foo.set(foo: 'foo', bar: 1, )
33
-
34
- ```
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "deepstream"
7
- spec.version = "0.0.3"
7
+ spec.version = "0.0.4"
8
8
  spec.authors = ["Piotr Szczudlak"]
9
9
  spec.email = ["thisredoned@gmail.com"]
10
10
 
@@ -75,7 +75,7 @@ class Deepstream::Client
75
75
  end
76
76
 
77
77
  def _open_socket
78
- timeout(2) { @socket = TCPSocket.new(@address, @port) }
78
+ Timeout.timeout(2) { @socket = TCPSocket.new(@address, @port) }
79
79
  Thread.start do
80
80
  loop { _process_msg(@socket.gets(30.chr).tap { |m| break m.chomp(30.chr).split(31.chr) if m }) }
81
81
  end
@@ -108,6 +108,7 @@ class Deepstream::Client
108
108
  when %w{E EVT} then _fire_event_callback(msg)
109
109
  when %w{R P} then @records[msg[2]]._patch(msg[3], msg[4], _parse_data(msg[5]))
110
110
  when %w{R U} then @records[msg[2]]._update(msg[3], _parse_data(msg[4]))
111
+ when %w{R A} then @records.delete(msg[3]) if msg[2] == 'D'
111
112
  else @unread_msg = msg
112
113
  end
113
114
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepstream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Szczudlak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-03 00:00:00.000000000 Z
11
+ date: 2015-09-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Basic ruby client for the deepstream.io server
14
14
  email: