active_event 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_event/event_source_server.rb +0 -1
- data/lib/active_event/sse.rb +20 -0
- data/lib/active_event/version.rb +1 -1
- data/lib/active_event.rb +2 -0
- data/spec/spec_helper.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d91f56abebe4f2866575b3287883a391a8f68ed2
|
4
|
+
data.tar.gz: abda8849cfc95059a4b9c67c34a91173d8cd24cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50be3d3c1c7b26a1d4e7be8f861eb62bc9e2d12f838ecb9808ebc672c38da7048ae27212bcf53b10e8feb57e8e645d4b10f7c91f2e4d3d12dbf98fa6105b3508
|
7
|
+
data.tar.gz: d27ce0a1282fe85c7829d51668fc5e267fa1ec698c6bb0e23a3a8ca78265e4983c8dd6e42f8d8371c2ce234befd9d0aa3d208b1fb0fc5e0af399b32e79c0d477
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module ActiveEvent
|
4
|
+
class SSE
|
5
|
+
def initialize(io)
|
6
|
+
@io = io
|
7
|
+
end
|
8
|
+
|
9
|
+
def write(object, options = {})
|
10
|
+
options.each do |k, v|
|
11
|
+
@io.write "#{k}: #{v}\n"
|
12
|
+
end
|
13
|
+
@io.write "data: #{JSON.dump(object)}\n\n"
|
14
|
+
end
|
15
|
+
|
16
|
+
def close
|
17
|
+
@io.close
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/active_event/version.rb
CHANGED
data/lib/active_event.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Reischuck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -121,7 +121,7 @@ dependencies:
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
124
|
+
name: coveralls
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
127
|
- - '>='
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
description: Event server, validations, commands and events for rails-disco
|
138
|
-
email:
|
138
|
+
email: rails-disco@hicknhack-software.com
|
139
139
|
executables: []
|
140
140
|
extensions: []
|
141
141
|
extra_rdoc_files: []
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/active_event/event_source_server.rb
|
151
151
|
- lib/active_event/event_type.rb
|
152
152
|
- lib/active_event/replay_server.rb
|
153
|
+
- lib/active_event/sse.rb
|
153
154
|
- lib/active_event/support/attr_initializer.rb
|
154
155
|
- lib/active_event/support/attr_setter.rb
|
155
156
|
- lib/active_event/support/autoload.rb
|