active_domain 0.5.0.rc4 → 0.5.0.rc5
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/command_routes.rb +37 -35
- data/lib/active_domain/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c578bca76f3fc16070c077cf8ca1952ce09005ca
|
4
|
+
data.tar.gz: d72dc78bb181a82692535e80fdcae621a15c302b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f27517d7629677b08bc4a1243fc633da9091e882e5ec95892821fb3a0dc1a2bd054daf0ff23cc192a3c63126d34f0b158b95b866dac7f6f481d97778ac8e4f3
|
7
|
+
data.tar.gz: dbf2b0571ad252db6d03efd4a01806727da71755d9fab0c47164a75d1cb0569d261f5d3c48a4034e4e39c5523e6b57ea1bb3dc3ba43654cdf9c12e264911e855
|
@@ -1,35 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
1
|
+
require 'active_event/domain'
|
2
|
+
|
3
|
+
module ActiveDomain
|
4
|
+
class CommandRoutes
|
5
|
+
def version
|
6
|
+
'0.1.0'
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
self.processors = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def run_command(command)
|
14
|
+
RELOADER.execute_if_updated
|
15
|
+
processor, method = @@routes[command.class]
|
16
|
+
processor_instance(processor).method(method).call(command)
|
17
|
+
rescue Exception => e
|
18
|
+
LOGGER.error e.message
|
19
|
+
LOGGER.error e.backtrace.join("\n")
|
20
|
+
raise ActiveEvent::DomainExceptionCapture, ["#{e.class.name}: #{e.message}", e.backtrace].to_json, e.backtrace
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.route(type, processor, method)
|
24
|
+
@@routes[type] = [processor, method]
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_accessor :processors
|
30
|
+
|
31
|
+
def processor_instance(processor)
|
32
|
+
processors[processor] ||= processor.new
|
33
|
+
end
|
34
|
+
|
35
|
+
@@routes = {}
|
36
|
+
end
|
37
|
+
end
|
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.5.0.
|
4
|
+
version: 0.5.0.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HicknHack Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04
|
11
|
+
date: 2014-05-04 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.5.0.
|
19
|
+
version: 0.5.0.rc5
|
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.5.0.
|
26
|
+
version: 0.5.0.rc5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,11 +146,14 @@ executables: []
|
|
146
146
|
extensions: []
|
147
147
|
extra_rdoc_files: []
|
148
148
|
files:
|
149
|
+
- MIT-LICENSE
|
150
|
+
- README.md
|
149
151
|
- app/models/active_domain/event.rb
|
150
152
|
- app/models/active_domain/event_repository.rb
|
151
153
|
- app/models/active_domain/unique_command_id.rb
|
152
154
|
- app/models/active_domain/unique_command_id_repository.rb
|
153
155
|
- db/migrate/02_create_unique_command_ids.rb
|
156
|
+
- lib/active_domain.rb
|
154
157
|
- lib/active_domain/autoload.rb
|
155
158
|
- lib/active_domain/command_processor.rb
|
156
159
|
- lib/active_domain/command_routes.rb
|
@@ -158,9 +161,6 @@ files:
|
|
158
161
|
- lib/active_domain/projection_registry.rb
|
159
162
|
- lib/active_domain/server.rb
|
160
163
|
- lib/active_domain/version.rb
|
161
|
-
- lib/active_domain.rb
|
162
|
-
- README.md
|
163
|
-
- MIT-LICENSE
|
164
164
|
- spec/lib/command_processor_spec.rb
|
165
165
|
- spec/lib/projection_registry_spec.rb
|
166
166
|
- spec/lib/projection_spec.rb
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: 1.3.1
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.2.2
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Domain specifics for the Rails Disco
|