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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2879ba83c33e9ab5c2a5db8263e01e1cc00f983
4
- data.tar.gz: d160e8c142951bc87a2a816406ab30bbf6a08b8b
3
+ metadata.gz: d91f56abebe4f2866575b3287883a391a8f68ed2
4
+ data.tar.gz: abda8849cfc95059a4b9c67c34a91173d8cd24cc
5
5
  SHA512:
6
- metadata.gz: a4f62dfaedef9fe9c2838b9f4035f093a3ac68df9319e6e3e2e9d7b6fbd6f5d6c3db5c83dbbe234e906e338b4e2f4fd56cfc39e7adbc6551b0da0410b972cc1e
7
- data.tar.gz: 21a407982c30b6bf8140fbb682a47201c45568e5d3ce80a8f052b5106bcb0200ba1f160e7ce032910f488b4beaa9dda2bcedfd3f4ba194b620ac934fc6862709
6
+ metadata.gz: 50be3d3c1c7b26a1d4e7be8f861eb62bc9e2d12f838ecb9808ebc672c38da7048ae27212bcf53b10e8feb57e8e645d4b10f7c91f2e4d3d12dbf98fa6105b3508
7
+ data.tar.gz: d27ce0a1282fe85c7829d51668fc5e267fa1ec698c6bb0e23a3a8ca78265e4983c8dd6e42f8d8371c2ce234befd9d0aa3d208b1fb0fc5e0af399b32e79c0d477
@@ -1,4 +1,3 @@
1
- require 'reloader/sse'
2
1
  require 'bunny'
3
2
  module ActiveEvent
4
3
  module EventSourceServer
@@ -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
@@ -1,7 +1,7 @@
1
1
  module ActiveEvent
2
2
  # Returns the version of the currently loaded ActiveEvent as a Gem::Version
3
3
  def self.version
4
- Gem::Version.new '0.2.0'
4
+ Gem::Version.new '0.3.0'
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
data/lib/active_event.rb CHANGED
@@ -9,8 +9,10 @@ module ActiveEvent
9
9
  autoload :Command
10
10
  autoload :Domain
11
11
  autoload :EventServer
12
+ autoload :EventSourceServer
12
13
  autoload :EventType
13
14
  autoload :ReplayServer
15
+ autoload :SSE
14
16
  autoload :Validations
15
17
  autoload :ValidationsRegistry
16
18
 
data/spec/spec_helper.rb CHANGED
@@ -1 +1,5 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+ require 'factory_girl'
4
+
1
5
  require 'active_event'
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.2.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-04 00:00:00.000000000 Z
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: sqlite3
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: andreas.reischuck@hicknhack-software.com
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