resque-stages 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: ddca44a98bf2ebb0f69ab9aca16e8459600f8b3e3403294ed5154092605d2ab0
4
- data.tar.gz: 53c298bc979c5f35f8f518cb993c7f701dbe54aa821209ee3bab9c066a896e8e
3
+ metadata.gz: 5cd7806755d4dd68b345e13f058f6018df4a2501262f7408b5ff0ef51b0c4c07
4
+ data.tar.gz: 8f43021dba1e51d28877358cc68f470a5895da667bf7aebd5e1291bfa605c023
5
5
  SHA512:
6
- metadata.gz: ce74afa066345f6d4e1e7b5ba96bbe92aaeb0452fc5a26133ae0d085447cf4fcbf16ce8f8fbe430bc2dc2ef5471aacff81044685bd331625a40ad68a03213d95
7
- data.tar.gz: c554aaa9f3d73f9a4ef3055bf4580c4e800bfbd86a8da052a536fb0792adfc2209f81991d17e80adf18769973e1c319815a3ccb53c2a67224f4b0024b5c57de7
6
+ metadata.gz: 7b1a4db410a255e0fc5a52fa1e9b96fe5efd9368140c769ff6b5261954ecd87e516b224d895787fba2d68c29b06e6463ec2955c0fe1fce2bac74af1686c1dbe3
7
+ data.tar.gz: 0fa5cb6e4eb3820a67ca303afcc9f536c84eaa86f7a80c5860321ebd3ce4a492c8e23e04334b1c0f6cfa720a02346f433699762179ca4ad7c566832961d51220
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- resque-stages (0.0.1)
4
+ resque-stages (0.0.3)
5
5
  redis
6
6
  redis-namespace
7
7
  resque
@@ -31,6 +31,8 @@ module Resque
31
31
  job.args = args
32
32
  end
33
33
 
34
+ job = perform_job(*job.uncompressed_args) if job.compressed?
35
+
34
36
  job
35
37
  end
36
38
 
@@ -176,6 +176,10 @@ module Resque
176
176
  staged_group_stage.verify_job(self)
177
177
  end
178
178
 
179
+ def compressed?
180
+ compressable? && described_class.compressed?(args)
181
+ end
182
+
179
183
  private
180
184
 
181
185
  def build_new_structure
@@ -3,7 +3,7 @@
3
3
  module Resque
4
4
  module Plugins
5
5
  module Stages
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
  end
8
8
  end
9
9
  end
@@ -324,7 +324,11 @@ RSpec.describe Resque::Plugins::Stages do
324
324
  perform_args[0].delete :staged_job_id
325
325
  perform_args[0]["this_is"] = "silly"
326
326
 
327
- expect(perform_job.args).to eq perform_args
327
+ if perform_args.length > 1
328
+ expect(perform_job.args).to eq perform_args
329
+ else
330
+ expect(perform_job.args).to eq match_args
331
+ end
328
332
  end
329
333
 
330
334
  it "creates a new job if there is no id" do
@@ -334,7 +338,7 @@ RSpec.describe Resque::Plugins::Stages do
334
338
  perform_args[0].delete :staged_job_id
335
339
  end
336
340
 
337
- expect(perform_job.args).to eq perform_args
341
+ expect(perform_job.args).to eq match_args
338
342
  end
339
343
  end
340
344
 
@@ -351,16 +355,8 @@ RSpec.describe Resque::Plugins::Stages do
351
355
  context "CompressedJob" do
352
356
  let(:job) { Resque::Plugins::Stages::StagedJob.create_job(stage, CompressedJob, "This", 1, :is, an: "arglist") }
353
357
  let(:load_job) { Resque::Plugins::Stages::StagedJob.new(job.job_id) }
354
- let(:perform_args) do
355
- [{ "resque_compressed" => true,
356
- "payload" => CompressedJob.compressed_args([{ "staged_job_id" => job.job_id }, "This", 1, :is, an: "arglist"]),
357
- staged_job_id: job.job_id }]
358
- end
359
- let(:match_args) do
360
- [{ "resque_compressed" => true,
361
- "payload" => CompressedJob.compressed_args([{ "staged_job_id" => job.job_id }, "This", 1, :is, an: "arglist"]),
362
- staged_job_id: job.job_id }]
363
- end
358
+ let(:perform_args) { job.enqueue_compressed_args }
359
+ let(:match_args) { ["This", 1, "is", "an" => "arglist"] }
364
360
  let(:perform_job) { CompressedJob.perform_job(*perform_args) }
365
361
 
366
362
  it_behaves_like "it loads from args"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-stages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - RealNobody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-14 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis