attr-gather 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/attr/gather/version.rb +1 -1
- data/lib/attr/gather/workflow/task_execution_result.rb +22 -3
- 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: 07ef681505341f374e4374d1baf4b5a8630a34b5dc87dc4fcaec159b2a7efeb2
|
4
|
+
data.tar.gz: 680bc4891c2a140b6af5e780d97dba80e7ceb5aa750f8a0fe88dffcf7327c9f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a634990d091aff5b530c06341e2cb2fdbad34cbec9f4b4dee073245822f45633fab79cbb8c4b76ee95dcda62d56a5b1ec856ac4b7500d04f9478a548664e070
|
7
|
+
data.tar.gz: 6c1dddb4c8478d28ced0677c2b1b4b86343404f645721dde7af77ed9cdc44e880f1ece2fd3a271b26ed85b2325b7b8d4c5ce6cffaa5e1e9b4c2b589c0430dfb7
|
data/Gemfile.lock
CHANGED
data/lib/attr/gather/version.rb
CHANGED
@@ -20,11 +20,11 @@ module Attr
|
|
20
20
|
|
21
21
|
attr_reader :task, :result, :started_at, :uuid
|
22
22
|
|
23
|
-
def initialize(task, result)
|
24
|
-
@started_at = Time.now
|
25
|
-
@uuid = SecureRandom.uuid
|
23
|
+
def initialize(task, result, started_at: Time.now, uuid: SecureRandom.uuid) # rubocop:disable Metrics/LineLength
|
26
24
|
@task = task
|
27
25
|
@result = result
|
26
|
+
@started_at = started_at
|
27
|
+
@uuid = uuid
|
28
28
|
end
|
29
29
|
|
30
30
|
# @!attribute [r] state
|
@@ -41,6 +41,25 @@ module Attr
|
|
41
41
|
result.value!
|
42
42
|
end
|
43
43
|
|
44
|
+
# Chain a new block result to be executed after resolution
|
45
|
+
#
|
46
|
+
# @return [TaskExecutionResult] the new task execution result
|
47
|
+
# @yield The block operation to be performed asynchronously.
|
48
|
+
def then(*args, &block)
|
49
|
+
new_result = result.then(*args, &block)
|
50
|
+
self.class.new(task, new_result, started_at: @started_at, uuid: @uuid)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Catch an async exception when a failure occurs
|
54
|
+
#
|
55
|
+
# @return [TaskExecutionResult] the new task execution result
|
56
|
+
# @yield The block operation to be performed asynchronously.
|
57
|
+
def catch(*args, &block)
|
58
|
+
new_result = result.catch(*args, &block)
|
59
|
+
self.class.new(task, new_result, started_at: @started_at, uuid: @uuid)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Executes a block after the result is fulfilled
|
44
63
|
# Represents the TaskExecutionResult as a hash
|
45
64
|
#
|
46
65
|
# @return [Hash]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr-gather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|