rails_event_store_active_record 0.24.0 → 0.25.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
- SHA1:
3
- metadata.gz: aa7cbc8a46e69a907a86eb49221525581ced5792
4
- data.tar.gz: e585c4784333d52636512824facd16ebc5b09657
2
+ SHA256:
3
+ metadata.gz: f9fd377e72155bd6cfbf362cb257a9803e3e217d145dc0927409cd0d8bdb544b
4
+ data.tar.gz: b6709c25f323833c9b6abe8d9a35ee7f39d4bb9242fae38a464a8e668e8f4235
5
5
  SHA512:
6
- metadata.gz: 919a3e5a8715712d4a4750d7885a8889cacf8acca6abb23f1e975f797149a10df2cd4f5971cd406d6ff9a46972fae6890d648dd17d06d50c4cc2dccf728678e0
7
- data.tar.gz: 00da8c71db44a47186acd50b1d99dcca82646d47777cdcb22d39cee96f15734c57babb722cdc73d0fffa4c0d1e04e8b7f68ed9bc3e5ce391ad5e5a40ee9eec5e
6
+ metadata.gz: 8daa44c33f3675406b9a2d1640c6c8fb50781247a2c3f64e5f79365ced11a39a05bdb537301305f99e0bab72bb2049e4925d326b05514f81f922fa6b5cb08ab6
7
+ data.tar.gz: a21f84bfdb846dc15757bdab319cfdc28e2fb795f2758c0d37e57508bcfb576dc9bddd8880bfe2a2c23d07aa1a9a6f1179bf3a37fd2fd4e52ff4cb0d3d6584cf
data/Makefile CHANGED
@@ -1,4 +1,9 @@
1
- GEM_VERSION = `cat ../RES_VERSION`
1
+ GEM_VERSION = $(shell cat ../RES_VERSION)
2
+ GEM_NAME = rails_event_store_active_record
3
+ REQUIRE = $(GEM_NAME)
4
+ IGNORE = RailsEventStoreActiveRecord::IndexViolationDetector\#detect
5
+ SUBJECT ?= RailsEventStoreActiveRecord*
6
+ DATABASE_URL ?= sqlite3::memory:
2
7
 
3
8
  install: ## Install gem dependencies
4
9
  @echo "Installing gem dependencies"
@@ -6,22 +11,30 @@ install: ## Install gem dependencies
6
11
  @echo "Installing v1_v2_schema_migration gem dependencies"
7
12
  @BUNDLE_GEMFILE=spec/v1_v2_schema_migration/Gemfile bundle install
8
13
 
9
- test: ## Run tests
10
- @echo "Running basic tests - beware: this won't guarantee build pass"
14
+ test: ## Run unit tests
15
+ @echo "Running unit tests"
11
16
  @bundle exec rspec
12
17
 
13
- mutate: test ## Run mutation tests
14
- @echo "Running mutation tests - only 100% free mutation will be accepted"
15
- @bundle exec mutant --include lib --require ruby_event_store --use rspec "RailsEventStoreActiveRecord*" \
16
- --ignore-subject "RailsEventStoreActiveRecord::IndexViolationDetector#detect"
18
+ mutate: test ## Run mutation tests
19
+ @echo "Running mutation tests"
20
+ @DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
21
+ $(addprefix --require ,$(REQUIRE)) \
22
+ $(addprefix --ignore-subject ,$(IGNORE)) \
23
+ --use rspec "$(SUBJECT)"
17
24
 
18
25
  build:
19
- @gem build -V rails_event_store_active_record.gemspec
26
+ @echo "Building gem package"
27
+ @gem build -V $(GEM_NAME).gemspec
20
28
  @mkdir -p pkg/
21
- @mv rails_event_store_active_record-$(GEM_VERSION).gem pkg/
29
+ @mv $(GEM_NAME)-$(GEM_VERSION).gem pkg/
22
30
 
23
- release: build
24
- @gem push pkg/rails_event_store_active_record-$(GEM_VERSION).gem
31
+ push:
32
+ @echo "Pushing package to RubyGems"
33
+ @gem push pkg/$(GEM_NAME)-$(GEM_VERSION).gem
34
+
35
+ clean:
36
+ @echo "Removing previously built package"
37
+ -rm pkg/$(GEM_NAME)-$(GEM_VERSION).gem
25
38
 
26
39
  help:
27
40
  @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -73,8 +73,6 @@ module RailsEventStoreActiveRecord
73
73
 
74
74
  private
75
75
 
76
- attr_reader :mapper
77
-
78
76
  def add_to_stream(collection, stream_name, expected_version, include_global, &to_event_id)
79
77
  raise RubyEventStore::InvalidExpectedVersion if stream_name.eql?(RubyEventStore::GLOBAL_STREAM) && !expected_version.equal?(:any)
80
78
 
@@ -136,7 +134,7 @@ module RailsEventStoreActiveRecord
136
134
  end
137
135
 
138
136
  def build_event_record(event)
139
- serialized_record = mapper.event_to_serialized_record(event)
137
+ serialized_record = @mapper.event_to_serialized_record(event)
140
138
  Event.new(
141
139
  id: serialized_record.event_id,
142
140
  data: serialized_record.data,
@@ -82,7 +82,7 @@ module RailsEventStoreActiveRecord
82
82
  end
83
83
 
84
84
  def get_all_streams
85
- (["all"] + EventInStream.pluck(:stream))
85
+ (["all"] + EventInStream.order(:id).pluck(:stream))
86
86
  .uniq
87
87
  .map { |name| RubyEventStore::Stream.new(name) }
88
88
  end
@@ -101,4 +101,4 @@ module RailsEventStoreActiveRecord
101
101
  end
102
102
 
103
103
  private_constant(:EventRepositoryReader)
104
- end
104
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsEventStoreActiveRecord
2
- VERSION = "0.24.0"
2
+ VERSION = "0.25.0"
3
3
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'fakefs', '~> 0.11.2'
31
31
  spec.add_development_dependency 'childprocess'
32
32
 
33
- spec.add_dependency 'ruby_event_store', '= 0.24.0'
33
+ spec.add_dependency 'ruby_event_store', '= 0.25.0'
34
34
  spec.add_dependency 'activesupport', '>= 3.0'
35
35
  spec.add_dependency 'activemodel', '>= 3.0'
36
36
  spec.add_dependency 'activerecord-import', '~> 0.21'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store_active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 0.24.0
159
+ version: 0.25.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 0.24.0
166
+ version: 0.25.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: activesupport
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  requirements: []
255
255
  rubyforge_project:
256
- rubygems_version: 2.6.13
256
+ rubygems_version: 2.7.5
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: Active Record events repository for Rails Event Store