evt-message_store-postgres 1.1.0.0 → 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/lib/message_store/postgres.rb +0 -2
- metadata +2 -3
- data/lib/message_store/postgres/stream_name.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77c708beeefed6f49a2a8df231fc7d8bb84ef2dd75982dc602cb5b6893662869
|
4
|
+
data.tar.gz: 3255fa00e94215b04d61fac3054ad4db43e64813c266232cf333e79345d7f49d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b1e8f43a95d701db50f9c21964a52acebe8c435b11c91befb6a0e1c1cdf25b8a33f50d0457f1a4af0f34cfd6d426eb2bd918fef8c953af4deabd861a45ee0a4
|
7
|
+
data.tar.gz: 5e63109d9eb4a60f9c2af6c50ee4adca1929fd224defbe558d47e96c5264ebb884553235cbf5962f9f3d1575fefa9f49ec58d10f4795143ba160a94a9dad67a4
|
@@ -11,8 +11,6 @@ require 'message_store/postgres/log'
|
|
11
11
|
require 'message_store/postgres/settings'
|
12
12
|
require 'message_store/postgres/session'
|
13
13
|
|
14
|
-
require 'message_store/postgres/stream_name'
|
15
|
-
|
16
14
|
require 'message_store/postgres/put'
|
17
15
|
require 'message_store/postgres/write'
|
18
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-message_store-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: scripts
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-message_store
|
@@ -144,7 +144,6 @@ files:
|
|
144
144
|
- lib/message_store/postgres/read.rb
|
145
145
|
- lib/message_store/postgres/session.rb
|
146
146
|
- lib/message_store/postgres/settings.rb
|
147
|
-
- lib/message_store/postgres/stream_name.rb
|
148
147
|
- lib/message_store/postgres/write.rb
|
149
148
|
homepage: https://github.com/eventide-project/message-store-postgres
|
150
149
|
licenses:
|
@@ -1,52 +0,0 @@
|
|
1
|
-
module MessageStore
|
2
|
-
module Postgres
|
3
|
-
module StreamName
|
4
|
-
def self.stream_name(category_name, id=nil, type: nil, types: nil)
|
5
|
-
types = Array(types)
|
6
|
-
types.unshift(type) unless type.nil?
|
7
|
-
|
8
|
-
type_list = nil
|
9
|
-
type_list = types.join('+') unless types.empty?
|
10
|
-
|
11
|
-
stream_name = category_name
|
12
|
-
stream_name = "#{stream_name}:#{type_list}" unless type_list.nil?
|
13
|
-
stream_name = "#{stream_name}-#{id}" unless id.nil?
|
14
|
-
|
15
|
-
stream_name
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.get_id(stream_name)
|
19
|
-
id = stream_name.partition('-').last
|
20
|
-
id.empty? ? nil : id
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.get_category(stream_name)
|
24
|
-
stream_name.split('-').first
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.category?(stream_name)
|
28
|
-
!stream_name.include?('-')
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.get_type_list(stream_name)
|
32
|
-
type = stream_name.split(':').last.split('-').first
|
33
|
-
|
34
|
-
return nil if stream_name.start_with?(type)
|
35
|
-
|
36
|
-
type
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.get_types(stream_name)
|
40
|
-
type_list = get_type_list(stream_name)
|
41
|
-
|
42
|
-
return [] if type_list.nil?
|
43
|
-
|
44
|
-
type_list.split('+')
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.get_entity_name(stream_name)
|
48
|
-
get_category(stream_name).split(':').first
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|