gush 0.3.1 → 0.3.2
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/README.md +2 -0
- data/gush.gemspec +1 -1
- data/lib/gush.rb +7 -3
- data/lib/gush/client.rb +1 -1
- data/spec/gush/client_spec.rb +11 -0
- data/spec/spec_helper.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 530121f8210176d74b4ee481c929d123c227c247
|
|
4
|
+
data.tar.gz: 6c69a21fdba018faae42f33de3a506ac01c7b881
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 353836d226553352646b590ca924df5f6b64f1dcfb1c07e1a677fbf93bd3875fe9f569db3c4f6b9a3817aff4907eaa827178fcdefcaca234668585682b8f36e7
|
|
7
|
+
data.tar.gz: 6d8613db3477f98f9e66ff72f873f126fec5fee0a5262aaa37adc163a9bebc785698967fc17764b3ce0393a5ab98d4c4aa6117d689bc4496233ae846d050d0c0
|
data/README.md
CHANGED
data/gush.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "gush"
|
|
7
|
-
spec.version = "0.3.
|
|
7
|
+
spec.version = "0.3.2"
|
|
8
8
|
spec.authors = ["Piotrek Okoński"]
|
|
9
9
|
spec.email = ["piotrek@okonski.org"]
|
|
10
10
|
spec.summary = "Fast and distributed workflow runner using only Sidekiq and Redis"
|
data/lib/gush.rb
CHANGED
|
@@ -33,14 +33,18 @@ module Gush
|
|
|
33
33
|
|
|
34
34
|
def self.configure
|
|
35
35
|
yield configuration
|
|
36
|
-
|
|
36
|
+
reconfigure_sidekiq
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
def self.
|
|
39
|
+
def self.reconfigure_sidekiq
|
|
40
40
|
Sidekiq.configure_server do |config|
|
|
41
41
|
config.redis = { url: configuration.redis_url, queue: configuration.namespace}
|
|
42
42
|
end
|
|
43
|
+
|
|
44
|
+
Sidekiq.configure_client do |config|
|
|
45
|
+
config.redis = { url: configuration.redis_url, queue: configuration.namespace}
|
|
46
|
+
end
|
|
43
47
|
end
|
|
44
48
|
end
|
|
45
49
|
|
|
46
|
-
Gush.
|
|
50
|
+
Gush.reconfigure_sidekiq
|
data/lib/gush/client.rb
CHANGED
|
@@ -143,7 +143,7 @@ module Gush
|
|
|
143
143
|
attr_reader :sidekiq, :redis
|
|
144
144
|
|
|
145
145
|
def workflow_from_hash(hash, nodes = nil)
|
|
146
|
-
flow = hash[:klass].constantize.new
|
|
146
|
+
flow = hash[:klass].constantize.new *hash[:arguments]
|
|
147
147
|
flow.jobs = []
|
|
148
148
|
flow.stopped = hash.fetch(:stopped, false)
|
|
149
149
|
flow.id = hash[:id]
|
data/spec/gush/client_spec.rb
CHANGED
|
@@ -15,6 +15,7 @@ describe Gush::Client do
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
context "when given workflow exists" do
|
|
18
|
+
|
|
18
19
|
it "returns Workflow object" do
|
|
19
20
|
expected_workflow = TestWorkflow.create
|
|
20
21
|
workflow = client.find_workflow(expected_workflow.id)
|
|
@@ -22,6 +23,16 @@ describe Gush::Client do
|
|
|
22
23
|
expect(workflow.id).to eq(expected_workflow.id)
|
|
23
24
|
expect(workflow.jobs.map(&:name)).to match_array(expected_workflow.jobs.map(&:name))
|
|
24
25
|
end
|
|
26
|
+
|
|
27
|
+
context "when workflow has parameters" do
|
|
28
|
+
it "returns Workflow object" do
|
|
29
|
+
expected_workflow = ParameterTestWorkflow.create(true)
|
|
30
|
+
workflow = client.find_workflow(expected_workflow.id)
|
|
31
|
+
|
|
32
|
+
expect(workflow.id).to eq(expected_workflow.id)
|
|
33
|
+
expect(workflow.jobs.map(&:name)).to match_array(expected_workflow.jobs.map(&:name))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
25
36
|
end
|
|
26
37
|
end
|
|
27
38
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gush
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Piotrek Okoński
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sidekiq
|
|
@@ -256,3 +256,4 @@ test_files:
|
|
|
256
256
|
- spec/gush/workflow_spec.rb
|
|
257
257
|
- spec/gush_spec.rb
|
|
258
258
|
- spec/spec_helper.rb
|
|
259
|
+
has_rdoc:
|