evt-message_store 1.0.1.0 → 1.0.1.1
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/stream_name.rb +17 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23b4e429e5c187e8de005adf7a2f148de18c4893e76456f50075e1f2d6dd782d
|
4
|
+
data.tar.gz: 94135a7d2f2c4f11014cf5bd3d564571ecc665d8d7cd8e93c728793fd9b3f107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aedd66443542670741cf422a2e4ab4836dd26a882e8c453e3365112fb2060a4ccbb07162fd0c226575459f5ff91c1a421005fdfc4b9a84c0ee71bbb5fde31e6
|
7
|
+
data.tar.gz: dc8dee30c6c22c1d5a2206b380cff2edd2d4e968b5687b5f071480d107802f0aae07363b303d5676967769700ad37755bff46151757eb48fbaa657accf279a5c
|
@@ -2,6 +2,18 @@ module MessageStore
|
|
2
2
|
module StreamName
|
3
3
|
Error = Class.new(RuntimeError)
|
4
4
|
|
5
|
+
def self.id_delimiter
|
6
|
+
'-'
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.category_delimiter
|
10
|
+
':'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.type_delimiter
|
14
|
+
'+'
|
15
|
+
end
|
16
|
+
|
5
17
|
def self.stream_name(category_name, id=nil, type: nil, types: nil)
|
6
18
|
if category_name == nil
|
7
19
|
raise Error, "Category name must not be omitted from stream name"
|
@@ -11,29 +23,17 @@ module MessageStore
|
|
11
23
|
types.unshift(type) unless type.nil?
|
12
24
|
|
13
25
|
type_list = nil
|
14
|
-
type_list = types.join(
|
26
|
+
type_list = types.join(type_delimiter) unless types.empty?
|
15
27
|
|
16
28
|
stream_name = category_name
|
17
|
-
stream_name = "#{stream_name}
|
18
|
-
stream_name = "#{stream_name}
|
29
|
+
stream_name = "#{stream_name}#{category_delimiter}#{type_list}" unless type_list.nil?
|
30
|
+
stream_name = "#{stream_name}#{id_delimiter}#{id}" unless id.nil?
|
19
31
|
|
20
32
|
stream_name
|
21
33
|
end
|
22
34
|
|
23
|
-
def self.stream_delimiter
|
24
|
-
'-'
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.category_delimiter
|
28
|
-
':'
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.type_delimiter
|
32
|
-
'+'
|
33
|
-
end
|
34
|
-
|
35
35
|
def self.split(stream_name)
|
36
|
-
stream_name.split(
|
36
|
+
stream_name.split(id_delimiter, 2)
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.get_id(stream_name)
|
@@ -45,7 +45,7 @@ module MessageStore
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.category?(stream_name)
|
48
|
-
!stream_name.include?(
|
48
|
+
!stream_name.include?(id_delimiter)
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.get_type_list(stream_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-message_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1.
|
4
|
+
version: 1.0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-casing
|