euston 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
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.6'
4
- s.date = '2012-01-30'
3
+ s.version = '1.2.7'
4
+ s.date = '2012-02-02'
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']
@@ -22,7 +22,7 @@ module Euston
22
22
  end
23
23
 
24
24
  attr_accessor :log
25
- attr_reader :aggregate_id
25
+ attr_reader :aggregate_id, :stream
26
26
 
27
27
  def initial_version
28
28
  @initial_version ||= 0
@@ -111,6 +111,7 @@ module Euston
111
111
 
112
112
  def apply_stream stream
113
113
  @aggregate_id = stream.stream_id
114
+ @stream = stream
114
115
 
115
116
  events = stream.committed_events
116
117
  return if events.empty?
@@ -122,12 +123,10 @@ module Euston
122
123
  end
123
124
  end
124
125
 
125
- def publish_command command, dispatch_at = Time.now.to_f
126
+ def publish_command command
126
127
  raise ArgumentError, 'Commands must subclass Euston::Command' unless command.is_a? Euston::Command
127
128
  raise Euston::Errors::InvalidCommandError, "An attempt was made to publish an invalid command from an aggregate root.\n\nAggregate id: #{@aggregate_id}\nAggregate type: #{self.class.name}\nCommand: #{command.to_hash}\nErrors: #{command.errors}" unless command.valid?
128
129
 
129
- command.headers[:dispatch_at] = dispatch_at
130
-
131
130
  uncommitted_commands << command
132
131
  end
133
132
 
@@ -1,3 +1,3 @@
1
1
  module Euston
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: euston
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-01-30 00:00:00.000000000 Z
13
+ date: 2012-02-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
17
- requirement: &19676560 !ruby/object:Gem::Requirement
17
+ requirement: &70197026912700 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.10
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *19676560
25
+ version_requirements: *70197026912700
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
- requirement: &19676080 !ruby/object:Gem::Requirement
28
+ requirement: &70197026912220 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.0.10
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *19676080
36
+ version_requirements: *70197026912220
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: fuubar
39
- requirement: &19675620 !ruby/object:Gem::Requirement
39
+ requirement: &70197026911760 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *19675620
47
+ version_requirements: *70197026911760
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
- requirement: &19675160 !ruby/object:Gem::Requirement
50
+ requirement: &70197026911300 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 0.9.2
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *19675160
58
+ version_requirements: *70197026911300
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec
61
- requirement: &19674700 !ruby/object:Gem::Requirement
61
+ requirement: &70197026910840 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 2.6.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *19674700
69
+ version_requirements: *70197026910840
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: uuid
72
- requirement: &19674240 !ruby/object:Gem::Requirement
72
+ requirement: &70197026910380 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: 2.3.0
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *19674240
80
+ version_requirements: *70197026910380
81
81
  description: ''
82
82
  email:
83
83
  - lee.m.henson@gmail.com
@@ -136,4 +136,9 @@ rubygems_version: 1.8.10
136
136
  signing_key:
137
137
  specification_version: 3
138
138
  summary: Cqrs tooling.
139
- test_files: []
139
+ test_files:
140
+ - spec/aggregate_command_map_spec.rb
141
+ - spec/aggregate_root_samples.rb
142
+ - spec/aggregate_root_spec.rb
143
+ - spec/command_headers_spec.rb
144
+ - spec/spec_helper.rb