sourced-message 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sourced/message.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab48ba13a4c9d34b8b50fac74177da86672fb65bc55ebccd869b53299c24129c
|
|
4
|
+
data.tar.gz: 7c055a6c838bc91f31971bbdc8eb1b1b598d2531ee8627317ba9e2eae572acb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19774b1fa8a68caa0b3074da601e03710f94f7996a2b6ef2b7dcc593abb32d6c34f8a17a71ea7d5be5ad508e4dafde6ad617518de054f04e3b1f2c56e97c4ac1
|
|
7
|
+
data.tar.gz: b859d67f328cca620ffc66d15f87cfa33054d0b726bdbb17344a7a5d9f6be1adef325b8abfe960bc6f2a6d702dc95fb3583f2bb4ef42539d35251e851acf798d
|
data/lib/sourced/message.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Sourced
|
|
|
22
22
|
# +Sourced::Message.registry[type]+ resolves a type registered under any
|
|
23
23
|
# subclass. Resolve from this root to see the whole tree.
|
|
24
24
|
class Message < Plumb::Types::Data
|
|
25
|
-
VERSION = '0.1.
|
|
25
|
+
VERSION = '0.1.1'
|
|
26
26
|
|
|
27
27
|
EMPTY_ARRAY = [].freeze
|
|
28
28
|
|
|
@@ -40,12 +40,13 @@ module Sourced
|
|
|
40
40
|
UnknownMessageError = Class.new(ArgumentError)
|
|
41
41
|
# Raised by {#at} when a message would be scheduled in the past.
|
|
42
42
|
PastMessageDateError = Class.new(ArgumentError)
|
|
43
|
+
LaxTime = Types::Time | Types::String.build(::Time, :parse).policy(:rescue, ::ArgumentError)
|
|
43
44
|
|
|
44
45
|
attribute :id, Types::AutoUUID
|
|
45
46
|
attribute :type, Types::String.present
|
|
46
47
|
attribute? :causation_id, Types::UUID::V4
|
|
47
48
|
attribute? :correlation_id, Types::UUID::V4
|
|
48
|
-
attribute :created_at,
|
|
49
|
+
attribute :created_at, LaxTime.default { Time.now }
|
|
49
50
|
attribute :metadata, Types::Hash.default(Plumb::BLANK_HASH)
|
|
50
51
|
attribute :payload, Types::Static[nil]
|
|
51
52
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sourced-message
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ismael Celis
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.0.
|
|
18
|
+
version: 0.0.18
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.0.
|
|
25
|
+
version: 0.0.18
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: fugit
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|