rails_event_store_active_record 0.6.7 → 0.6.8

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: 7971839a18f14ead8acce31c1c37d83111aded5f
4
- data.tar.gz: 6ee483660ea16bb041b0e616b482e40b27b332bd
3
+ metadata.gz: 0cec1f2b02acf358bf64453d63885163942ad521
4
+ data.tar.gz: e278d30e2f9ad0f2610ba25257fda6d02aa1fb02
5
5
  SHA512:
6
- metadata.gz: 9ce0d7368646d7c3db929130cd2a51106d33edab4dd946098bc1bb52e36e260c481dffe6309492df861842ec33631db0a5b03a185c33e8f77c81ef01edccfb1d
7
- data.tar.gz: 2e880bc3dee89e3576835f7645e15299c86af048a2b8e280b5c7d91d52cbbf02998c85c37ab6fdc59ba1fbdb6c7b5c366a9a6adfea5458cdded5f01975a4beb9
6
+ metadata.gz: c4b2034109c8199e5da08aa8e8ce132393252b21112a3d72eb492d7ea5a1b70b15d6979edad285f729d42110d5ac1bec30041b7aa2c261e3d409761dae5107a6
7
+ data.tar.gz: a2b8a035bdcbdcf30c0ad81a08c56856ecbf74a363eeee5c257ff916effb36cb210c6399681a76f19c5d3e8a632dce86113fe96d2cb2eb98dc05d15b4278e0c5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.6.8 (11.08.2016)
2
+
3
+ * ruby_event_store updated to 0.12.1
4
+ * make this gem mutant free - 100% mutation tests coverage
5
+
1
6
  ### 0.6.7 (10.08.2016)
2
7
 
3
8
  * ruby_event_store updated to 0.12.0
data/Makefile CHANGED
@@ -10,7 +10,7 @@ test: ## Run tests
10
10
 
11
11
  mutate: test ## Run mutation tests
12
12
  @echo "Running mutation tests - only 100% free mutation will be accepted"
13
- @bundle exec mutant --include lib --require ruby_event_store --use rspec "RailsEventStoreActiveRecord*" --expected-coverage 615/699
13
+ @bundle exec mutant --include lib --require ruby_event_store --use rspec "RailsEventStoreActiveRecord*"
14
14
 
15
15
  .PHONY: help
16
16
 
@@ -1,12 +1,12 @@
1
1
  module RailsEventStoreActiveRecord
2
2
  class EventRepository
3
- def initialize(adapter: ::RailsEventStoreActiveRecord::Event)
3
+ def initialize(adapter: Event)
4
4
  @adapter = adapter
5
5
  end
6
6
  attr_reader :adapter
7
7
 
8
8
  def create(event, stream_name)
9
- data = event.to_h.merge!(stream: stream_name, event_type: event.class.name)
9
+ data = event.to_h.merge!(stream: stream_name, event_type: event.class)
10
10
  adapter.create(data)
11
11
  event
12
12
  end
@@ -14,7 +14,6 @@ module RailsEventStoreActiveRecord
14
14
  def delete_stream(stream_name)
15
15
  condition = {stream: stream_name}
16
16
  adapter.destroy_all condition
17
- nil
18
17
  end
19
18
 
20
19
  def has_event?(event_id)
@@ -25,18 +24,14 @@ module RailsEventStoreActiveRecord
25
24
  build_event_entity(adapter.where(stream: stream_name).last)
26
25
  end
27
26
 
28
- def get_all_events
29
- adapter.order('id ASC').order('stream').all.map(&method(:build_event_entity))
30
- end
31
-
32
27
  def read_events_forward(stream_name, start_event_id, count)
33
28
  stream = adapter.where(stream: stream_name)
34
29
  unless start_event_id.equal?(:head)
35
30
  starting_event = adapter.find_by(event_id: start_event_id)
36
- stream = stream.where('id > ?', starting_event.id)
31
+ stream = stream.where('id > ?', starting_event)
37
32
  end
38
33
 
39
- stream.order('id ASC').limit(count)
34
+ stream.limit(count)
40
35
  .map(&method(:build_event_entity))
41
36
  end
42
37
 
@@ -44,7 +39,7 @@ module RailsEventStoreActiveRecord
44
39
  stream = adapter.where(stream: stream_name)
45
40
  unless start_event_id.equal?(:head)
46
41
  starting_event = adapter.find_by(event_id: start_event_id)
47
- stream = stream.where('id < ?', starting_event.id)
42
+ stream = stream.where('id < ?', starting_event)
48
43
  end
49
44
 
50
45
  stream.order('id DESC').limit(count)
@@ -52,7 +47,7 @@ module RailsEventStoreActiveRecord
52
47
  end
53
48
 
54
49
  def read_stream_events_forward(stream_name)
55
- adapter.where(stream: stream_name).order('id ASC')
50
+ adapter.where(stream: stream_name)
56
51
  .map(&method(:build_event_entity))
57
52
  end
58
53
 
@@ -65,10 +60,10 @@ module RailsEventStoreActiveRecord
65
60
  stream = adapter
66
61
  unless start_event_id.equal?(:head)
67
62
  starting_event = adapter.find_by(event_id: start_event_id)
68
- stream = stream.where('id > ?', starting_event.id)
63
+ stream = stream.where('id > ?', starting_event)
69
64
  end
70
65
 
71
- stream.order('id ASC').limit(count)
66
+ stream.limit(count)
72
67
  .map(&method(:build_event_entity))
73
68
  end
74
69
 
@@ -76,7 +71,7 @@ module RailsEventStoreActiveRecord
76
71
  stream = adapter
77
72
  unless start_event_id.equal?(:head)
78
73
  starting_event = adapter.find_by(event_id: start_event_id)
79
- stream = stream.where('id < ?', starting_event.id)
74
+ stream = stream.where('id < ?', starting_event)
80
75
  end
81
76
 
82
77
  stream.order('id DESC').limit(count)
@@ -1,3 +1,3 @@
1
1
  module RailsEventStoreActiveRecord
2
- VERSION = "0.6.7"
2
+ VERSION = "0.6.8"
3
3
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rails', '~> 4.2'
27
27
  spec.add_development_dependency 'sqlite3'
28
28
 
29
- spec.add_dependency 'ruby_event_store', '~> 0.12.0'
29
+ spec.add_dependency 'ruby_event_store', '~> 0.12.1'
30
30
  spec.add_dependency 'activesupport', '>= 3.0'
31
31
  spec.add_dependency 'activemodel', '>= 3.0'
32
32
  spec.add_development_dependency 'mutant-rspec', '~> 0.8'
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.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.12.0
103
+ version: 0.12.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.12.0
110
+ version: 0.12.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: activesupport
113
113
  requirement: !ruby/object:Gem::Requirement