ruby_event_store-rom 1.3.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/ruby_event_store/rom/changesets/create_events.rb +10 -18
- data/lib/ruby_event_store/rom/changesets/create_stream_entries.rb +6 -11
- data/lib/ruby_event_store/rom/changesets/update_events.rb +32 -19
- data/lib/ruby_event_store/rom/event_repository.rb +53 -51
- data/lib/ruby_event_store/rom/index_violation_detector.rb +29 -0
- data/lib/ruby_event_store/rom/mappers/event_to_serialized_record.rb +4 -4
- data/lib/ruby_event_store/rom/mappers/stream_entry_to_serialized_record.rb +5 -4
- data/lib/ruby_event_store/rom/rake_task.rb +5 -0
- data/lib/ruby_event_store/rom/relations/events.rb +81 -0
- data/lib/ruby_event_store/rom/relations/stream_entries.rb +90 -0
- data/lib/ruby_event_store/rom/repositories/events.rb +43 -29
- data/lib/ruby_event_store/rom/repositories/stream_entries.rb +7 -13
- data/lib/ruby_event_store/rom/{adapters/sql/tasks → tasks}/migration_tasks.rake +9 -9
- data/lib/ruby_event_store/rom/types.rb +2 -2
- data/lib/ruby_event_store/rom/unit_of_work.rb +29 -13
- data/lib/ruby_event_store/rom/version.rb +1 -1
- data/lib/ruby_event_store/rom.rb +29 -102
- data/lib/ruby_event_store-rom.rb +1 -1
- metadata +29 -48
- data/.rubocop.yml +0 -1
- data/.rubocop_todo.yml +0 -84
- data/CHANGELOG.md +0 -9
- data/Gemfile +0 -12
- data/Makefile +0 -57
- data/Rakefile +0 -20
- data/db/migrate/20180327044629_create_ruby_event_store_tables.rb +0 -54
- data/db/migrate/20181026152045_index_by_event_type.rb +0 -9
- data/lib/ruby_event_store/rom/adapters/memory/changesets/create_events.rb +0 -19
- data/lib/ruby_event_store/rom/adapters/memory/changesets/create_stream_entries.rb +0 -19
- data/lib/ruby_event_store/rom/adapters/memory/changesets/update_events.rb +0 -18
- data/lib/ruby_event_store/rom/adapters/memory/relations/events.rb +0 -56
- data/lib/ruby_event_store/rom/adapters/memory/relations/stream_entries.rb +0 -114
- data/lib/ruby_event_store/rom/adapters/memory/unit_of_work.rb +0 -36
- data/lib/ruby_event_store/rom/adapters/sql/changesets/create_events.rb +0 -15
- data/lib/ruby_event_store/rom/adapters/sql/changesets/update_events.rb +0 -41
- data/lib/ruby_event_store/rom/adapters/sql/index_violation_detector.rb +0 -31
- data/lib/ruby_event_store/rom/adapters/sql/rake_task.rb +0 -5
- data/lib/ruby_event_store/rom/adapters/sql/relations/events.rb +0 -27
- data/lib/ruby_event_store/rom/adapters/sql/relations/stream_entries.rb +0 -72
- data/lib/ruby_event_store/rom/memory.rb +0 -82
- data/lib/ruby_event_store/rom/sql.rb +0 -169
- data/lib/ruby_event_store/rom/tuple_uniqueness_error.rb +0 -21
- data/lib/ruby_event_store/spec/rom/event_repository_lint.rb +0 -176
- data/lib/ruby_event_store/spec/rom/relations/events_lint.rb +0 -75
- data/lib/ruby_event_store/spec/rom/relations/stream_entries_lint.rb +0 -198
- data/lib/ruby_event_store/spec/rom/spec_helper_lint.rb +0 -15
- data/lib/ruby_event_store/spec/rom/unit_of_work_lint.rb +0 -37
- data/ruby_event_store-rom.gemspec +0 -37
@@ -1,52 +1,46 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '../mappers/event_to_serialized_record'
|
4
|
-
require_relative '../changesets/create_events'
|
5
|
-
require_relative '../changesets/update_events'
|
6
|
-
|
7
3
|
module RubyEventStore
|
8
4
|
module ROM
|
9
5
|
module Repositories
|
10
6
|
class Events < ::ROM::Repository[:events]
|
11
|
-
def create_changeset(
|
12
|
-
events.create_changeset(
|
7
|
+
def create_changeset(records)
|
8
|
+
events.create_changeset(records)
|
13
9
|
end
|
14
10
|
|
15
|
-
def update_changeset(
|
16
|
-
events.update_changeset(
|
11
|
+
def update_changeset(records)
|
12
|
+
events.update_changeset(records)
|
17
13
|
end
|
18
14
|
|
19
15
|
def find_nonexistent_pks(event_ids)
|
20
16
|
return event_ids unless event_ids.any?
|
21
17
|
|
22
|
-
event_ids - events.
|
18
|
+
event_ids - events.by_event_id(event_ids).pluck(:event_id)
|
23
19
|
end
|
24
20
|
|
25
21
|
def exist?(event_id)
|
26
|
-
events.
|
27
|
-
end
|
28
|
-
|
29
|
-
def by_id(event_id)
|
30
|
-
events.map_with(:event_to_serialized_record).by_pk(event_id).one!
|
22
|
+
events.by_event_id(event_id).exist?
|
31
23
|
end
|
32
24
|
|
33
|
-
def last_stream_event(stream)
|
25
|
+
def last_stream_event(stream, serializer)
|
34
26
|
query = stream_entries.ordered(:backward, stream)
|
35
|
-
query =
|
27
|
+
query = query.combine(:event)
|
28
|
+
query = query.map_with(:stream_entry_to_serialized_record, auto_struct: false)
|
29
|
+
query = query_builder(serializer, query, limit: 1)
|
36
30
|
query.first
|
37
31
|
end
|
38
32
|
|
39
|
-
def read(specification)
|
33
|
+
def read(specification, serializer)
|
40
34
|
query = read_scope(specification)
|
41
35
|
|
42
36
|
if specification.batched?
|
43
37
|
BatchEnumerator.new(
|
44
38
|
specification.batch_size,
|
45
39
|
specification.limit,
|
46
|
-
->(offset, limit) { query_builder(query, offset: offset, limit: limit).to_ary }
|
40
|
+
->(offset, limit) { query_builder(serializer, query, offset: offset, limit: limit).to_ary }
|
47
41
|
).each
|
48
42
|
else
|
49
|
-
query = query_builder(query, limit: (specification.limit if specification.limit?))
|
43
|
+
query = query_builder(serializer, query, limit: (specification.limit if specification.limit?))
|
50
44
|
if !specification.start && !specification.stop
|
51
45
|
specification.first? || specification.last? ? query.first : query.each
|
52
46
|
elsif specification.last?
|
@@ -63,31 +57,51 @@ module RubyEventStore
|
|
63
57
|
query.count
|
64
58
|
end
|
65
59
|
|
60
|
+
def global_position(event_id)
|
61
|
+
record = events.by_event_id(event_id).one
|
62
|
+
raise EventNotFound.new(event_id) if record.nil?
|
63
|
+
record.id - 1
|
64
|
+
end
|
65
|
+
|
66
66
|
protected
|
67
67
|
|
68
68
|
def read_scope(specification)
|
69
|
-
offset_entry_id = stream_entries.by_stream_and_event_id(specification.stream, specification.start).fetch(:id) if specification.start
|
70
|
-
stop_entry_id = stream_entries.by_stream_and_event_id(specification.stream, specification.stop).fetch(:id) if specification.stop
|
71
|
-
|
72
69
|
direction = specification.forward? ? :forward : :backward
|
73
70
|
|
74
71
|
if specification.last? && !specification.start && !specification.stop
|
75
72
|
direction = specification.forward? ? :backward : :forward
|
76
73
|
end
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
if specification.stream.global?
|
76
|
+
offset_entry_id = events.by_event_id(specification.start).one!.fetch(:id) if specification.start
|
77
|
+
stop_entry_id = events.by_event_id(specification.stop).one!.fetch(:id) if specification.stop
|
78
|
+
|
79
|
+
query = events.ordered(direction, offset_entry_id, stop_entry_id, specification.time_sort_by)
|
80
|
+
query = query.map_with(:event_to_serialized_record, auto_struct: false)
|
81
|
+
else
|
82
|
+
offset_entry_id = stream_entries.by_stream_and_event_id(specification.stream, specification.start).fetch(:id) if specification.start
|
83
|
+
stop_entry_id = stream_entries.by_stream_and_event_id(specification.stream, specification.stop).fetch(:id) if specification.stop
|
84
|
+
|
85
|
+
query = stream_entries.ordered(direction, specification.stream, offset_entry_id, stop_entry_id, specification.time_sort_by)
|
86
|
+
query = query.combine(:event)
|
87
|
+
query = query.map_with(:stream_entry_to_serialized_record, auto_struct: false)
|
88
|
+
end
|
89
|
+
|
90
|
+
query = query.by_event_id(specification.with_ids) if specification.with_ids
|
91
|
+
query = query.by_event_type(specification.with_types) if specification.with_types?
|
92
|
+
query = query.older_than(specification.older_than) if specification.older_than
|
93
|
+
query = query.older_than_or_equal(specification.older_than_or_equal) if specification.older_than_or_equal
|
94
|
+
query = query.newer_than(specification.newer_than) if specification.newer_than
|
95
|
+
query = query.newer_than_or_equal(specification.newer_than_or_equal) if specification.newer_than_or_equal
|
81
96
|
query
|
82
97
|
end
|
83
98
|
|
84
|
-
def query_builder(query, offset: nil, limit: nil)
|
99
|
+
def query_builder(serializer, query, offset: nil, limit: nil)
|
85
100
|
query = query.offset(offset) if offset
|
86
101
|
query = query.take(limit) if limit
|
87
|
-
|
88
102
|
query
|
89
|
-
.
|
90
|
-
.
|
103
|
+
.to_a
|
104
|
+
.map { |serialized_record| serialized_record.deserialize(serializer) }
|
91
105
|
end
|
92
106
|
end
|
93
107
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '../mappers/stream_entry_to_serialized_record'
|
4
|
-
require_relative '../changesets/create_stream_entries'
|
5
|
-
|
6
3
|
module RubyEventStore
|
7
4
|
module ROM
|
8
5
|
module Repositories
|
9
6
|
class StreamEntries < ::ROM::Repository[:stream_entries]
|
10
7
|
POSITION_SHIFT = 1
|
11
8
|
|
12
|
-
def create_changeset(event_ids, stream, resolved_version
|
9
|
+
def create_changeset(event_ids, stream, resolved_version)
|
13
10
|
tuples = []
|
14
11
|
|
15
12
|
event_ids.each_with_index do |event_id, index|
|
@@ -20,14 +17,6 @@ module RubyEventStore
|
|
20
17
|
event_id: event_id
|
21
18
|
}
|
22
19
|
end
|
23
|
-
|
24
|
-
next unless global_stream
|
25
|
-
|
26
|
-
tuples << {
|
27
|
-
stream: stream_entries.class::SERIALIZED_GLOBAL_STREAM_NAME,
|
28
|
-
position: nil,
|
29
|
-
event_id: event_id
|
30
|
-
}
|
31
20
|
end
|
32
21
|
|
33
22
|
stream_entries.create_changeset(tuples)
|
@@ -45,7 +34,12 @@ module RubyEventStore
|
|
45
34
|
|
46
35
|
def streams_of(event_id)
|
47
36
|
stream_entries.by_event_id(event_id).map { |e| e[:stream] }
|
48
|
-
|
37
|
+
end
|
38
|
+
|
39
|
+
def position_in_stream(event_id, stream)
|
40
|
+
record = stream_entries.by_stream(stream).by_event_id(event_id).one
|
41
|
+
raise EventNotFoundInStream if record.nil?
|
42
|
+
record.position
|
49
43
|
end
|
50
44
|
end
|
51
45
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "ruby_event_store/rom"
|
4
4
|
|
5
|
-
MIGRATIONS_PATH =
|
5
|
+
MIGRATIONS_PATH = "db/migrate".freeze
|
6
6
|
|
7
|
-
desc
|
8
|
-
task
|
7
|
+
desc "Setup ROM EventRespository environment"
|
8
|
+
task "db:setup" do
|
9
9
|
Dir.chdir(Dir.pwd)
|
10
10
|
ROM::SQL::RakeSupport.env = ::RubyEventStore::ROM.configure(:sql).rom_container
|
11
11
|
end
|
12
12
|
|
13
|
-
desc
|
14
|
-
task
|
13
|
+
desc "Copy RubyEventStore SQL migrations to db/migrate"
|
14
|
+
task "db:migrations:copy" => "db:setup" do
|
15
15
|
# Optional data type for `data` and `metadata`
|
16
|
-
data_type = ENV[
|
16
|
+
data_type = ENV["DATA_TYPE"]
|
17
17
|
|
18
|
-
Dir[File.join(File.dirname(__FILE__),
|
18
|
+
Dir[File.join(File.dirname(__FILE__), "../../../../../../", MIGRATIONS_PATH, "/*.rb")].each do |input|
|
19
19
|
contents = File.read(input)
|
20
|
-
name = File.basename(input,
|
20
|
+
name = File.basename(input, ".*").sub(/\d+_/, "")
|
21
21
|
|
22
22
|
re_data_type = /(ENV.+?DATA_TYPE.+?\|\|=\s*)['"](jsonb?|text)['"]/
|
23
23
|
|
@@ -16,9 +16,9 @@ module RubyEventStore
|
|
16
16
|
end
|
17
17
|
.default { ::DateTime.now.new_offset(0) }
|
18
18
|
|
19
|
-
SerializedRecordSerializer = ::ROM::Types::String
|
20
19
|
# detects if the value is a Sequel::Postgres::JSONHash or Sequel::Postgres::JSONBHash
|
21
|
-
|
20
|
+
RecordDeserializer = ::ROM::Types::String.constructor { |v| v.class.name.upcase.include?("JSON") ? JSON.dump(v) : v }
|
21
|
+
RecordSerializer = ::ROM::Types::String
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -3,22 +3,38 @@
|
|
3
3
|
module RubyEventStore
|
4
4
|
module ROM
|
5
5
|
class UnitOfWork
|
6
|
-
|
7
|
-
|
8
|
-
def initialize(rom: ROM.env)
|
9
|
-
@env = rom
|
6
|
+
def initialize(gateway)
|
7
|
+
@gateway = gateway
|
10
8
|
end
|
11
9
|
|
12
|
-
def call
|
13
|
-
gateway = @env.rom_container.gateways.fetch(options.delete(:gateway) { :default })
|
14
|
-
|
10
|
+
def call
|
15
11
|
yield(changesets = [])
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
@gateway.transaction(
|
13
|
+
savepoint: true,
|
14
|
+
# See: https://github.com/jeremyevans/sequel/blob/master/doc/transactions.rdoc
|
15
|
+
#
|
16
|
+
# Committing changesets concurrently causes MySQL deadlocks
|
17
|
+
# which are not caught and retried by Sequel's built-in
|
18
|
+
# :retry_on option. This appears to be a result of how ROM
|
19
|
+
# handles exceptions which don't bubble up so that Sequel
|
20
|
+
# can retry transactions with the :retry_on option when there's
|
21
|
+
# a deadlock.
|
22
|
+
#
|
23
|
+
# This is exacerbated by the fact that changesets insert multiple
|
24
|
+
# tuples with individual INSERT statements because ROM specifies
|
25
|
+
# to Sequel to return a list of primary keys created. The likelihood
|
26
|
+
# of a deadlock is reduced with batched INSERT statements.
|
27
|
+
#
|
28
|
+
# For this reason we need to manually insert changeset records to avoid
|
29
|
+
# MySQL deadlocks or to allow Sequel to retry transactions
|
30
|
+
# when the :retry_on option is specified.
|
31
|
+
retry_on: Sequel::SerializationFailure,
|
32
|
+
before_retry: lambda { |_num, ex|
|
33
|
+
env.logger.warn("RETRY TRANSACTION [#{self.class.name} => #{ex.class.name}] #{ex.message}")
|
34
|
+
}
|
35
|
+
) do
|
36
|
+
changesets.each(&:commit)
|
37
|
+
end
|
22
38
|
end
|
23
39
|
end
|
24
40
|
end
|
data/lib/ruby_event_store/rom.rb
CHANGED
@@ -1,116 +1,43 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
require "ruby_event_store"
|
4
|
+
require "rom"
|
5
|
+
require "rom/sql"
|
6
|
+
require "rom/transformer"
|
7
|
+
|
8
|
+
require_relative "rom/changesets/create_events"
|
9
|
+
require_relative "rom/changesets/create_stream_entries"
|
10
|
+
require_relative "rom/changesets/update_events"
|
11
|
+
require_relative "rom/event_repository"
|
12
|
+
require_relative "rom/index_violation_detector"
|
13
|
+
require_relative "rom/mappers/event_to_serialized_record"
|
14
|
+
require_relative "rom/mappers/stream_entry_to_serialized_record"
|
15
|
+
require_relative "rom/relations/events"
|
16
|
+
require_relative "rom/relations/stream_entries"
|
17
|
+
require_relative "rom/repositories/events"
|
18
|
+
require_relative "rom/repositories/stream_entries"
|
19
|
+
require_relative "rom/types"
|
20
|
+
require_relative "rom/unit_of_work"
|
14
21
|
|
15
22
|
module RubyEventStore
|
16
23
|
module ROM
|
17
|
-
class Env
|
18
|
-
include Dry::Container::Mixin
|
19
|
-
|
20
|
-
attr_accessor :rom_container
|
21
|
-
|
22
|
-
def initialize(rom_container)
|
23
|
-
@rom_container = rom_container
|
24
|
-
|
25
|
-
register(:unique_violation_error_handlers, Set.new)
|
26
|
-
register(:not_found_error_handlers, Set.new)
|
27
|
-
register(:logger, Logger.new(STDOUT).tap { |logger| logger.level = Logger::WARN })
|
28
|
-
end
|
29
|
-
|
30
|
-
def logger
|
31
|
-
resolve(:logger)
|
32
|
-
end
|
33
|
-
|
34
|
-
def unit_of_work(&block)
|
35
|
-
options = resolve(:unit_of_work_options).dup
|
36
|
-
options.delete(:class) { UnitOfWork }.new(rom: self).call(**options, &block)
|
37
|
-
end
|
38
|
-
|
39
|
-
def register_unit_of_work_options(options)
|
40
|
-
register(:unit_of_work_options, options)
|
41
|
-
end
|
42
|
-
|
43
|
-
def register_error_handler(type, handler)
|
44
|
-
resolve(:"#{type}_error_handlers") << handler
|
45
|
-
end
|
46
|
-
|
47
|
-
def handle_error(type, *args, swallow: [])
|
48
|
-
yield
|
49
|
-
rescue StandardError => e
|
50
|
-
begin
|
51
|
-
resolve(:"#{type}_error_handlers").each { |h| h.call(e, *args) }
|
52
|
-
raise e
|
53
|
-
rescue *swallow
|
54
|
-
# swallow
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
24
|
class << self
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
Env.new ::ROM.container(adapter_name.tap(&block), &block)
|
67
|
-
else
|
68
|
-
Env.new ::ROM.container(adapter_name, database_uri, &block)
|
25
|
+
def setup(adapter_name, database_uri = ENV["DATABASE_URL"])
|
26
|
+
rom_container(adapter_name, database_uri) do |rom|
|
27
|
+
rom.register_mapper Mappers::StreamEntryToSerializedRecord
|
28
|
+
rom.register_mapper Mappers::EventToSerializedRecord
|
29
|
+
rom.register_relation Relations::Events
|
30
|
+
rom.register_relation Relations::StreamEntries
|
69
31
|
end
|
70
32
|
end
|
71
33
|
|
72
|
-
def setup(*args, &block)
|
73
|
-
configure(*args) do |config|
|
74
|
-
setup_defaults(config)
|
75
|
-
yield(config) if block
|
76
|
-
end.tap(&method(:configure_defaults))
|
77
|
-
end
|
78
|
-
|
79
34
|
private
|
80
35
|
|
81
|
-
def
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
config.register_mapper(ROM::Mappers::StreamEntryToSerializedRecord)
|
87
|
-
|
88
|
-
find_adapters(config.environment.gateways).each do |adapter|
|
89
|
-
adapter.setup(config)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def configure_defaults(env)
|
94
|
-
env.register_error_handler :not_found, lambda { |ex, event_id|
|
95
|
-
case ex
|
96
|
-
when ::ROM::TupleCountMismatchError
|
97
|
-
raise EventNotFound, event_id
|
98
|
-
end
|
99
|
-
}
|
100
|
-
|
101
|
-
find_adapters(env.rom_container.gateways).each do |adapter|
|
102
|
-
adapter.configure(env)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
def find_adapters(gateways)
|
107
|
-
# Setup for each kind of gateway class
|
108
|
-
gateways.values.map(&:class).uniq.map do |klass|
|
109
|
-
constant = klass.name.split('::')[1].to_sym
|
110
|
-
|
111
|
-
next unless RubyEventStore::ROM.constants.include?(constant)
|
112
|
-
|
113
|
-
RubyEventStore::ROM.const_get(constant)
|
36
|
+
def rom_container(adapter_name, database_uri, &block)
|
37
|
+
if adapter_name.is_a?(::ROM::Configuration)
|
38
|
+
::ROM.container(adapter_name.tap(&block), &block)
|
39
|
+
else
|
40
|
+
::ROM.container(adapter_name, database_uri, &block)
|
114
41
|
end
|
115
42
|
end
|
116
43
|
end
|
data/lib/ruby_event_store-rom.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_event_store-rom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Van Horn
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-container
|
@@ -95,90 +95,71 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: sequel
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 5.11.0
|
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:
|
110
|
+
version: 5.11.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: ruby_event_store
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 2.0.0
|
118
|
+
- - "<"
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 3.0.0
|
118
121
|
type: :runtime
|
119
122
|
prerelease: false
|
120
123
|
version_requirements: !ruby/object:Gem::Requirement
|
121
124
|
requirements:
|
122
125
|
- - ">="
|
123
126
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
125
|
-
|
126
|
-
|
127
|
-
|
127
|
+
version: 2.0.0
|
128
|
+
- - "<"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 3.0.0
|
131
|
+
description: Implementation of events repository based on ROM for Ruby Event Store
|
132
|
+
email: joel@joelvanhorn.com
|
128
133
|
executables: []
|
129
134
|
extensions: []
|
130
|
-
extra_rdoc_files:
|
135
|
+
extra_rdoc_files:
|
136
|
+
- README.md
|
131
137
|
files:
|
132
|
-
- ".rubocop.yml"
|
133
|
-
- ".rubocop_todo.yml"
|
134
|
-
- CHANGELOG.md
|
135
|
-
- Gemfile
|
136
|
-
- Makefile
|
137
138
|
- README.md
|
138
|
-
- Rakefile
|
139
|
-
- db/migrate/20180327044629_create_ruby_event_store_tables.rb
|
140
|
-
- db/migrate/20181026152045_index_by_event_type.rb
|
141
139
|
- lib/ruby_event_store-rom.rb
|
142
140
|
- lib/ruby_event_store/rom.rb
|
143
|
-
- lib/ruby_event_store/rom/adapters/memory/changesets/create_events.rb
|
144
|
-
- lib/ruby_event_store/rom/adapters/memory/changesets/create_stream_entries.rb
|
145
|
-
- lib/ruby_event_store/rom/adapters/memory/changesets/update_events.rb
|
146
|
-
- lib/ruby_event_store/rom/adapters/memory/relations/events.rb
|
147
|
-
- lib/ruby_event_store/rom/adapters/memory/relations/stream_entries.rb
|
148
|
-
- lib/ruby_event_store/rom/adapters/memory/unit_of_work.rb
|
149
|
-
- lib/ruby_event_store/rom/adapters/sql/changesets/create_events.rb
|
150
|
-
- lib/ruby_event_store/rom/adapters/sql/changesets/update_events.rb
|
151
|
-
- lib/ruby_event_store/rom/adapters/sql/index_violation_detector.rb
|
152
|
-
- lib/ruby_event_store/rom/adapters/sql/rake_task.rb
|
153
|
-
- lib/ruby_event_store/rom/adapters/sql/relations/events.rb
|
154
|
-
- lib/ruby_event_store/rom/adapters/sql/relations/stream_entries.rb
|
155
|
-
- lib/ruby_event_store/rom/adapters/sql/tasks/migration_tasks.rake
|
156
141
|
- lib/ruby_event_store/rom/changesets/create_events.rb
|
157
142
|
- lib/ruby_event_store/rom/changesets/create_stream_entries.rb
|
158
143
|
- lib/ruby_event_store/rom/changesets/update_events.rb
|
159
144
|
- lib/ruby_event_store/rom/event_repository.rb
|
145
|
+
- lib/ruby_event_store/rom/index_violation_detector.rb
|
160
146
|
- lib/ruby_event_store/rom/mappers/event_to_serialized_record.rb
|
161
147
|
- lib/ruby_event_store/rom/mappers/stream_entry_to_serialized_record.rb
|
162
|
-
- lib/ruby_event_store/rom/
|
148
|
+
- lib/ruby_event_store/rom/rake_task.rb
|
149
|
+
- lib/ruby_event_store/rom/relations/events.rb
|
150
|
+
- lib/ruby_event_store/rom/relations/stream_entries.rb
|
163
151
|
- lib/ruby_event_store/rom/repositories/events.rb
|
164
152
|
- lib/ruby_event_store/rom/repositories/stream_entries.rb
|
165
|
-
- lib/ruby_event_store/rom/
|
166
|
-
- lib/ruby_event_store/rom/tuple_uniqueness_error.rb
|
153
|
+
- lib/ruby_event_store/rom/tasks/migration_tasks.rake
|
167
154
|
- lib/ruby_event_store/rom/types.rb
|
168
155
|
- lib/ruby_event_store/rom/unit_of_work.rb
|
169
156
|
- lib/ruby_event_store/rom/version.rb
|
170
|
-
- lib/ruby_event_store/spec/rom/event_repository_lint.rb
|
171
|
-
- lib/ruby_event_store/spec/rom/relations/events_lint.rb
|
172
|
-
- lib/ruby_event_store/spec/rom/relations/stream_entries_lint.rb
|
173
|
-
- lib/ruby_event_store/spec/rom/spec_helper_lint.rb
|
174
|
-
- lib/ruby_event_store/spec/rom/unit_of_work_lint.rb
|
175
|
-
- ruby_event_store-rom.gemspec
|
176
157
|
homepage: https://railseventstore.org
|
177
158
|
licenses:
|
178
159
|
- MIT
|
179
160
|
metadata:
|
180
|
-
homepage_uri: https://railseventstore.org
|
181
|
-
changelog_uri: https://github.com/RailsEventStore/rails_event_store/
|
161
|
+
homepage_uri: https://railseventstore.org
|
162
|
+
changelog_uri: https://github.com/RailsEventStore/rails_event_store/blob/master/contrib/ruby_event_store-rom/CHANGELOG.md
|
182
163
|
source_code_uri: https://github.com/RailsEventStore/rails_event_store
|
183
164
|
bug_tracker_uri: https://github.com/RailsEventStore/rails_event_store/issues
|
184
165
|
post_install_message:
|
@@ -189,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
170
|
requirements:
|
190
171
|
- - ">="
|
191
172
|
- !ruby/object:Gem::Version
|
192
|
-
version: '2.
|
173
|
+
version: '2.5'
|
193
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
175
|
requirements:
|
195
176
|
- - ">="
|
data/.rubocop.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2018-12-29 04:25:35 -0500 using RuboCop version 0.61.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 3
|
10
|
-
Lint/HandleExceptions:
|
11
|
-
Exclude:
|
12
|
-
- 'Rakefile'
|
13
|
-
- 'lib/ruby_event_store/rom.rb'
|
14
|
-
- 'spec/spec_helper.rb'
|
15
|
-
|
16
|
-
# Offense count: 6
|
17
|
-
Metrics/AbcSize:
|
18
|
-
Max: 34
|
19
|
-
|
20
|
-
# Offense count: 8
|
21
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
22
|
-
# ExcludedMethods: refine
|
23
|
-
Metrics/BlockLength:
|
24
|
-
Max: 146
|
25
|
-
|
26
|
-
# Offense count: 2
|
27
|
-
Metrics/CyclomaticComplexity:
|
28
|
-
Max: 8
|
29
|
-
|
30
|
-
# Offense count: 6
|
31
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
32
|
-
Metrics/MethodLength:
|
33
|
-
Max: 30
|
34
|
-
|
35
|
-
# Offense count: 1
|
36
|
-
# Configuration parameters: CountComments.
|
37
|
-
Metrics/ModuleLength:
|
38
|
-
Max: 130
|
39
|
-
|
40
|
-
# Offense count: 2
|
41
|
-
Metrics/PerceivedComplexity:
|
42
|
-
Max: 11
|
43
|
-
|
44
|
-
# Offense count: 1
|
45
|
-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
46
|
-
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
47
|
-
Naming/FileName:
|
48
|
-
Exclude:
|
49
|
-
- 'lib/ruby_event_store-rom.rb'
|
50
|
-
|
51
|
-
# Offense count: 3
|
52
|
-
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
|
53
|
-
# NamePrefix: is_, has_, have_
|
54
|
-
# NamePrefixBlacklist: is_, has_, have_
|
55
|
-
# NameWhitelist: is_a?
|
56
|
-
# MethodDefinitionMacros: define_method, define_singleton_method
|
57
|
-
Naming/PredicateName:
|
58
|
-
Exclude:
|
59
|
-
- 'spec/**/*'
|
60
|
-
- 'lib/ruby_event_store/rom/event_repository.rb'
|
61
|
-
- 'lib/ruby_event_store/rom/memory.rb'
|
62
|
-
- 'lib/ruby_event_store/rom/sql.rb'
|
63
|
-
|
64
|
-
# Offense count: 16
|
65
|
-
# Cop supports --auto-correct.
|
66
|
-
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
67
|
-
# SupportedStyles: nested, compact
|
68
|
-
Style/ClassAndModuleChildren:
|
69
|
-
Enabled: false
|
70
|
-
|
71
|
-
# Offense count: 25
|
72
|
-
Style/Documentation:
|
73
|
-
Enabled: false
|
74
|
-
|
75
|
-
# Offense count: 2
|
76
|
-
Style/MultilineBlockChain:
|
77
|
-
Exclude:
|
78
|
-
- 'spec/rom/adapters/memory/relations/stream_entries_spec.rb'
|
79
|
-
|
80
|
-
# Offense count: 136
|
81
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
82
|
-
# URISchemes: http, https
|
83
|
-
Metrics/LineLength:
|
84
|
-
Max: 151
|