gush 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c0f45a09eb1260f6bcb00f1503181ddb4705735
4
- data.tar.gz: 13eaec20c3b1165127b5cb7761c99cdd5abc1f41
3
+ metadata.gz: 530121f8210176d74b4ee481c929d123c227c247
4
+ data.tar.gz: 6c69a21fdba018faae42f33de3a506ac01c7b881
5
5
  SHA512:
6
- metadata.gz: 1d1060e1575b133245e78280f96818a83c599fbd7f9b08a93d14c54c212cf3d1f4ae0f75a81883fcb49758b059a1bc51063e46c9121405408280570c124906ef
7
- data.tar.gz: 7bc51f1ad03adc625ebe497757c86fc588514d8a98d93e278ab961d1817653c21cf706858ad080d4e4fbc29e3d792b0a8d33598f67f126eccd0910d39f222843
6
+ metadata.gz: 353836d226553352646b590ca924df5f6b64f1dcfb1c07e1a677fbf93bd3875fe9f569db3c4f6b9a3817aff4907eaa827178fcdefcaca234668585682b8f36e7
7
+ data.tar.gz: 6d8613db3477f98f9e66ff72f873f126fec5fee0a5262aaa37adc163a9bebc785698967fc17764b3ce0393a5ab98d4c4aa6117d689bc4496233ae846d050d0c0
data/README.md CHANGED
@@ -237,6 +237,8 @@ end
237
237
 
238
238
  - [Mateusz Lenik](https://github.com/mlen)
239
239
  - [Michał Krzyżanowski](https://github.com/krzyzak)
240
+ - [Maciej Nowak](https://github.com/keqi)
241
+ - [Maciej Kołek](https://github.com/ferusinfo)
240
242
 
241
243
  ## Contributing
242
244
 
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.1"
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
- reconfigure_sidekiq_server
36
+ reconfigure_sidekiq
37
37
  end
38
38
 
39
- def self.reconfigure_sidekiq_server
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.reconfigure_sidekiq_server
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]
@@ -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
@@ -29,6 +29,12 @@ class TestWorkflow < Gush::Workflow
29
29
  end
30
30
  end
31
31
 
32
+ class ParameterTestWorkflow < Gush::Workflow
33
+ def configure(param)
34
+ run Prepare if param
35
+ end
36
+ end
37
+
32
38
  class Redis
33
39
  def publish(*)
34
40
  end
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.1
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-01-20 00:00:00.000000000 Z
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: