active_domain 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_domain/projection_registry.rb +2 -2
- data/lib/active_domain/server.rb +2 -0
- data/lib/active_domain/version.rb +1 -1
- data/spec/lib/command_processor_spec.rb +2 -1
- data/spec/spec_helper.rb +4 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eede4bb2ce3b3023a54aa077a8d7435030c3bc08
|
4
|
+
data.tar.gz: aa0e224f1bfc7d5200ccca9af0b06756348b6fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21cb5c325a92c01c08fea3cf84d3e5990b083e00136d90dffcafc14a555f6bda89127165547961da6d0532661e2f75dc31d4d3c05848d3450616bc9996c48c4f
|
7
|
+
data.tar.gz: 132a04dbc70cdc319fef1cf1348635559d96381021b0c2a864f47e78386a70aafffd093bbe07796eb8b947ae4506d8eef3d1c8687591b2c3c28745a505a0380f
|
@@ -16,7 +16,7 @@ module ActiveDomain
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def invoke(event)
|
19
|
-
event_type = event.class.name.
|
19
|
+
event_type = event.class.name.to_s
|
20
20
|
return unless handlers.has_key? event_type
|
21
21
|
handlers[event_type].each do |handler_method|
|
22
22
|
handler_method.owner.new.send handler_method.name, event
|
@@ -35,7 +35,7 @@ module ActiveDomain
|
|
35
35
|
self.class.registry.freeze.each do |handler|
|
36
36
|
handler.public_instance_methods(false).each do |method_name|
|
37
37
|
method = handler.instance_method method_name
|
38
|
-
event_type = method_name.to_s.camelcase
|
38
|
+
event_type = (method_name.to_s.split('__')*'/').camelcase
|
39
39
|
raise TooManyArgumentsError if 1 != method.arity
|
40
40
|
handlers[event_type] << method
|
41
41
|
end
|
data/lib/active_domain/server.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
describe ActiveDomain::CommandProcessor do
|
4
4
|
class TestDummy
|
5
|
+
include ActiveEvent::EventType
|
5
6
|
end
|
6
7
|
class TestDummyProcessor
|
7
8
|
include ActiveDomain::CommandProcessor
|
@@ -19,7 +20,7 @@ describe ActiveDomain::CommandProcessor do
|
|
19
20
|
|
20
21
|
describe 'instance' do
|
21
22
|
it 'allows event method' do
|
22
|
-
magic_number =
|
23
|
+
magic_number = TestDummy.new
|
23
24
|
expect(ActiveDomain::ProjectionRegistry).to receive(:invoke).with(magic_number)
|
24
25
|
expect(ActiveDomain::EventRepository).to receive(:store).with(magic_number)
|
25
26
|
expect(ActiveEvent::EventServer).to receive(:publish).with(magic_number)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_domain
|
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: active_event
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,8 +120,22 @@ dependencies:
|
|
120
120
|
- - '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: coveralls
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
123
137
|
description: Domain server, Command processors and routes for rails-disco
|
124
|
-
email:
|
138
|
+
email: rails-disco@hicknhack-software.com
|
125
139
|
executables: []
|
126
140
|
extensions: []
|
127
141
|
extra_rdoc_files: []
|