rsift 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsift (0.3.2)
4
+ rsift (0.3.4)
5
5
  em-http-request (= 0.2.15)
6
6
  jakal (= 0.1.95)
7
7
  json (= 1.4.6)
data/lib/rsift/socket.rb CHANGED
@@ -3,21 +3,33 @@ require 'em-http'
3
3
  module Rsift
4
4
 
5
5
  class Socket
6
-
6
+
7
7
  def self.perform(stream_identifier)
8
8
  endpoint = "ws://stream.datasift.net:8080/"
9
+
9
10
  EventMachine.run {
10
11
  http = EventMachine::HttpRequest.new(
11
12
  "#{endpoint}#{stream_identifier}").get(:timeout => 0)
12
-
13
- http.callback { puts "Connected to datasift" }
14
- http.errback { puts "something has failed" }
15
- http.disconnect { puts "oops, dropped connection?" }
16
-
13
+
14
+ http.callback do
15
+ puts "Connected to datasift"
16
+ end
17
+
18
+ http.errback do
19
+ raise SocketDisconnect.new("Datasift threw an error")
20
+ end
21
+
22
+ http.disconnect do
23
+ raise SocketDisconnect.new("Datasift disconnected me.")
24
+ end
25
+
17
26
  http.stream { |msg|
18
27
  yield msg
19
28
  }
20
29
  }
21
30
  end
22
31
  end
32
+
33
+ class SocketDisconnect < StandardError; end
34
+ class SocketError < StandardError; end
23
35
  end
data/lib/rsift/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rsift
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 3
9
- version: 0.3.3
8
+ - 4
9
+ version: 0.3.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Steven Shingler
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-28 00:00:00 +00:00
17
+ date: 2010-12-30 00:00:00 +00:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency