em-cometio-client 0.0.3 → 0.0.4

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.
data/History.txt CHANGED
@@ -1,12 +1,16 @@
1
- === 0.0.3 2013-3-5
1
+ === 0.0.4 2013-03-12
2
+
3
+ * parse multiple data on get
4
+
5
+ === 0.0.3 2013-03-05
2
6
 
3
7
  * modify default timeout
4
8
  * add timeout property
5
9
 
6
- === 0.0.2 2013-3-4
10
+ === 0.0.2 2013-03-04
7
11
 
8
12
  * add test
9
13
 
10
- === 0.0.1 2013-3-4
14
+ === 0.0.1 2013-03-04
11
15
 
12
16
  * EM::CometIO::Client
@@ -45,8 +45,11 @@ module EventMachine
45
45
  http = EM::HttpRequest.new("#{@url}?session=#{@session}", :connect_timeout => @timeout).get
46
46
  http.callback do |res|
47
47
  begin
48
- data = JSON.parse res.response
49
- self.emit data['type'], data['data']
48
+ data_arr = JSON.parse res.response
49
+ data_arr = [data_arr] unless data_arr.kind_of? Array
50
+ data_arr.each do |data|
51
+ self.emit data['type'], data['data']
52
+ end
50
53
  rescue JSON::ParserError
51
54
  rescue StandardError
52
55
  self.emit :error, "CometIO get error"
@@ -1,7 +1,7 @@
1
1
  module EventMachine
2
2
  module CometIO
3
3
  class Client
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-cometio-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-05 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine