conflow_spec 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/conflow_spec.gemspec +1 -1
- data/lib/conflow_spec/runner.rb +10 -6
- data/lib/conflow_spec/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f825412b9598784517b91a77fbd498a17c7fbcd82c806ffd1b02614dda38de1c
|
4
|
+
data.tar.gz: 1de417cdebfd0b8b86b9fbe79a929f2c7d93a0f808f00c0cdec111e03ae7b7f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbc9ed06d5cda7b56b2fd94dfb101861b88bc9d320a6eb8abefda293966c3e9ba90142cf83c651e95b42ec4ba96a8ebc9de8edad0f3f33a00e271c79db355d20
|
7
|
+
data.tar.gz: 8c8385fd1d54f3681c096262c55d44edb09f0fb0794187c77430961be397c85aa0e7d4141bcafabeb36506542d11d284d0e9120d21a0b23b63cc5169f00d54b6
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
conflow_spec (0.
|
5
|
-
conflow (~> 0.
|
4
|
+
conflow_spec (0.2.0)
|
5
|
+
conflow (~> 0.4)
|
6
6
|
rspec (~> 3.0)
|
7
7
|
|
8
8
|
GEM
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
ast (2.4.0)
|
12
12
|
coderay (1.1.2)
|
13
|
-
conflow (0.
|
13
|
+
conflow (0.4.1)
|
14
14
|
redis (~> 4.0)
|
15
15
|
diff-lcs (1.3)
|
16
16
|
docile (1.3.0)
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
coderay (~> 1.1.0)
|
25
25
|
method_source (~> 0.9.0)
|
26
26
|
rainbow (3.0.0)
|
27
|
-
rake (12.3.
|
27
|
+
rake (12.3.1)
|
28
28
|
redis (4.0.1)
|
29
29
|
rspec (3.7.0)
|
30
30
|
rspec-core (~> 3.7.0)
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
40
|
rspec-support (~> 3.7.0)
|
41
41
|
rspec-support (3.7.1)
|
42
|
-
rubocop (0.
|
42
|
+
rubocop (0.54.0)
|
43
43
|
parallel (~> 1.10)
|
44
44
|
parser (>= 2.5)
|
45
45
|
powerpack (~> 0.1)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
ruby-progressbar (~> 1.7)
|
48
48
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
49
49
|
ruby-progressbar (1.9.0)
|
50
|
-
simplecov (0.16.
|
50
|
+
simplecov (0.16.1)
|
51
51
|
docile (~> 1.1)
|
52
52
|
json (>= 1.8, < 3)
|
53
53
|
simplecov-html (~> 0.10.0)
|
data/conflow_spec.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "conflow", "~> 0.
|
23
|
+
spec.add_dependency "conflow", "~> 0.4"
|
24
24
|
spec.add_dependency "rspec", "~> 3.0"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.16"
|
data/lib/conflow_spec/runner.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
module ConflowSpec
|
4
4
|
# Runs the flow and collects informations about it
|
5
5
|
class Runner
|
6
|
+
include Conflow::Worker
|
7
|
+
|
6
8
|
attr_reader :flow, :performed_jobs
|
7
9
|
|
8
10
|
# @param flow [Conflow::Flow] instance of the flow
|
@@ -14,16 +16,18 @@ module ConflowSpec
|
|
14
16
|
|
15
17
|
# Performs all jobs in the flow, saving results in {performed_jobs}
|
16
18
|
def run
|
17
|
-
|
19
|
+
until queue.empty?
|
20
|
+
job = queue.pop
|
21
|
+
|
22
|
+
perform(flow.id, job.id) do |worker_type, params|
|
23
|
+
performed_jobs << [worker_type, params.to_h]
|
24
|
+
fetch_result(job)
|
25
|
+
end
|
26
|
+
end
|
18
27
|
end
|
19
28
|
|
20
29
|
private
|
21
30
|
|
22
|
-
def finish(job)
|
23
|
-
performed_jobs << [job.worker_type, job.params.to_h]
|
24
|
-
flow.finish(job, fetch_result(job))
|
25
|
-
end
|
26
|
-
|
27
31
|
def queue
|
28
32
|
flow.class.queue
|
29
33
|
end
|
data/lib/conflow_spec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conflow_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Begejowicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: conflow
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|