euston 1.2.0-java → 1.2.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/euston.gemspec +2 -3
- data/lib/euston/event_handler.rb +4 -4
- data/lib/euston/version.rb +1 -1
- data/lib/euston.rb +0 -1
- metadata +12 -13
- data/lib/euston/idempotence.rb +0 -27
data/euston.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'euston'
|
3
|
-
s.version = '1.2.
|
4
|
-
s.date = '2011-10-
|
3
|
+
s.version = '1.2.1'
|
4
|
+
s.date = '2011-10-13'
|
5
5
|
s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
|
6
6
|
s.authors = ['Lee Henson', 'Guy Boertje']
|
7
7
|
s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
|
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
|
|
29
29
|
lib/euston/event_handler.rb
|
30
30
|
lib/euston/event_handler_private_method_names.rb
|
31
31
|
lib/euston/event_headers.rb
|
32
|
-
lib/euston/idempotence.rb
|
33
32
|
lib/euston/null_logger.rb
|
34
33
|
lib/euston/repository.rb
|
35
34
|
lib/euston/version.rb
|
data/lib/euston/event_handler.rb
CHANGED
@@ -10,13 +10,13 @@ module Euston
|
|
10
10
|
module ClassMethods
|
11
11
|
def subscribes type, version = 1, opts = nil, &consumer
|
12
12
|
if self.include? Euston::AggregateRoot
|
13
|
-
|
13
|
+
o = { :id => :id }.merge opts
|
14
14
|
|
15
15
|
self.class.send :define_method, id_from_event_method_name(type, version) do |event|
|
16
|
-
if
|
17
|
-
|
16
|
+
if o[:id].respond_to? :call
|
17
|
+
o[:id].call event
|
18
18
|
else
|
19
|
-
event[
|
19
|
+
event[o[:id]]
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/euston/version.rb
CHANGED
data/lib/euston.rb
CHANGED
@@ -35,7 +35,6 @@ require 'euston/event'
|
|
35
35
|
require 'euston/event_handler_private_method_names'
|
36
36
|
require 'euston/event_handler'
|
37
37
|
require 'euston/event_headers'
|
38
|
-
require 'euston/idempotence'
|
39
38
|
require 'euston/null_logger'
|
40
39
|
require 'euston/aggregate_root'
|
41
40
|
require 'euston/repository'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: euston
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.1
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- Lee Henson
|
@@ -10,62 +10,62 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-10-
|
13
|
+
date: 2011-10-13 00:00:00.000000000 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activemodel
|
18
|
-
version_requirements: &
|
18
|
+
version_requirements: &2218 !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 3.0.9
|
23
23
|
none: false
|
24
|
-
requirement: *
|
24
|
+
requirement: *2218
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
|
-
version_requirements: &
|
29
|
+
version_requirements: &2236 !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 3.0.9
|
34
34
|
none: false
|
35
|
-
requirement: *
|
35
|
+
requirement: *2236
|
36
36
|
prerelease: false
|
37
37
|
type: :runtime
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: fuubar
|
40
|
-
version_requirements: &
|
40
|
+
version_requirements: &2252 !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 0.0.0
|
45
45
|
none: false
|
46
|
-
requirement: *
|
46
|
+
requirement: *2252
|
47
47
|
prerelease: false
|
48
48
|
type: :development
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rspec
|
51
|
-
version_requirements: &
|
51
|
+
version_requirements: &2270 !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 2.6.0
|
56
56
|
none: false
|
57
|
-
requirement: *
|
57
|
+
requirement: *2270
|
58
58
|
prerelease: false
|
59
59
|
type: :development
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: uuid
|
62
|
-
version_requirements: &
|
62
|
+
version_requirements: &2286 !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 2.3.0
|
67
67
|
none: false
|
68
|
-
requirement: *
|
68
|
+
requirement: *2286
|
69
69
|
prerelease: false
|
70
70
|
type: :development
|
71
71
|
description: ''
|
@@ -94,7 +94,6 @@ files:
|
|
94
94
|
- lib/euston/event_handler.rb
|
95
95
|
- lib/euston/event_handler_private_method_names.rb
|
96
96
|
- lib/euston/event_headers.rb
|
97
|
-
- lib/euston/idempotence.rb
|
98
97
|
- lib/euston/null_logger.rb
|
99
98
|
- lib/euston/repository.rb
|
100
99
|
- lib/euston/version.rb
|
data/lib/euston/idempotence.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
module Euston
|
2
|
-
module Idempotence
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
module InstanceMethods
|
6
|
-
def if_unhandled obj, headers
|
7
|
-
return if obj._history.include? headers.id
|
8
|
-
|
9
|
-
obj._history << headers.id
|
10
|
-
|
11
|
-
unless headers.source_message.nil? || obj._history.include?(headers.source_message[:headers][:id])
|
12
|
-
obj._history << headers.source_message[:headers][:id]
|
13
|
-
end
|
14
|
-
|
15
|
-
yield
|
16
|
-
end
|
17
|
-
|
18
|
-
def if_exists_and_unhandled document_type, id, headers
|
19
|
-
document = document_type.find id
|
20
|
-
|
21
|
-
if_unhandled document, headers do
|
22
|
-
yield document
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|