sandthorn 0.11.0 → 0.12.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: 3a2f65aa6777c6570a39697fe0dd6edcbc5fe17d
4
- data.tar.gz: 0a72c05d0fef7caf7c752bb24472a643b51b2854
3
+ metadata.gz: 264411828ceee4ea1915efe3f722133d514b4bf2
4
+ data.tar.gz: ec65529f45578093403dd4fc53042ea98b527594
5
5
  SHA512:
6
- metadata.gz: a3afc677df878cb3ae51f27e3b2beb37e82d549992a0915ffcedeccdcfcbe058780b525d4c593d508495063fa2e093e74d0252846bc3bcd7fd6ccb3e3236ea66
7
- data.tar.gz: 3b6a3637a931aedab5c8b1a18f76100b945ee9e84fe8dc83a0f44322e8c91cb927b40d3335720a6b08fefab0465918c4be09304915fe641cef3843b2e64f37b5
6
+ metadata.gz: 0d6ddfdf0147881f3d2346f7eee7d25a2d8c63e497d93bae583a94b49f78d34790ce16aa611aece9fdfcb179f70026cd095708c974b40828678ff7c3b87354cd
7
+ data.tar.gz: 40747fe40ae47821bef14ff855876861a2d2c76d7a69749d363282cc9f3c2eb291d07b188d1793f8c04fde83f2175a5473b3d56884e2b45166f73ea37a1b7ad9
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in sandthorn.gemspec
4
- gemspec
4
+ gemspec
@@ -52,6 +52,14 @@ module Sandthorn
52
52
  event_store_for(aggregate_type).get_aggregate_ids(aggregate_type: aggregate_type)
53
53
  end
54
54
 
55
+ def all aggregate_type
56
+ event_store_for(aggregate_type).all(aggregate_type)
57
+ end
58
+
59
+ def find aggregate_id, aggregate_type
60
+ event_store_for(aggregate_type).find(aggregate_id)
61
+ end
62
+
55
63
  def get_events event_store: :default, aggregate_types: [], take: 0, after_sequence_number: 0
56
64
  event_store = find_event_store(event_store)
57
65
  events = event_store.get_events aggregate_types: aggregate_types, take: take, after_sequence_number: after_sequence_number
@@ -72,8 +72,9 @@ module Sandthorn
72
72
  end
73
73
 
74
74
  def all
75
- aggregate_id_list = Sandthorn.get_aggregate_list_by_type(self)
76
- find aggregate_id_list
75
+ Sandthorn.all(self).map { |events|
76
+ aggregate_build events
77
+ }
77
78
  end
78
79
 
79
80
  def find id
@@ -82,7 +83,7 @@ module Sandthorn
82
83
  end
83
84
 
84
85
  def aggregate_find aggregate_id
85
- events = Sandthorn.get_aggregate(aggregate_id, self)
86
+ events = Sandthorn.find(aggregate_id, self)
86
87
  unless events && !events.empty?
87
88
  raise Sandthorn::Errors::AggregateNotFound
88
89
  end
@@ -1,3 +1,3 @@
1
1
  module Sandthorn
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "autotest-standalone"
31
31
  spec.add_development_dependency "sqlite3"
32
32
  spec.add_development_dependency "coveralls"
33
- spec.add_development_dependency "sandthorn_driver_sequel", ">= 3.0"
33
+ spec.add_development_dependency "sandthorn_driver_sequel", ">= 3.1"
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandthorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Krantz
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-11 00:00:00.000000000 Z
13
+ date: 2016-03-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -158,14 +158,14 @@ dependencies:
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: '3.0'
161
+ version: '3.1'
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
- version: '3.0'
168
+ version: '3.1'
169
169
  description: Event sourcing gem
170
170
  email:
171
171
  - lars.krantz@alaz.se
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.4.8
241
+ rubygems_version: 2.4.3
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Event sourcing gem