bushpig 0.1.9 → 0.1.10.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: 75f414bd5b386fdcd5d452374ab9d6f1076e59353e6a08416cd710f8119f0b9b
4
- data.tar.gz: 91cca09ccea7aa3b9169d15fe8174d16312892c8db7668408f0c594afcdcaef2
3
+ metadata.gz: 1efcbe37d7ae873706796ef83eacb28e8eaa8146c4f2a11059047d8720a46178
4
+ data.tar.gz: eed134f3dd8c22f164ae7033ce0b9268ce4c5e7afba581985bc4cb0a71cc31f1
5
5
  SHA512:
6
- metadata.gz: af10ea043bc302564ac0430b3531624c3d65b9c15cfc0e81e48f3cce9df314219b63c3bc1354de308420a6dd61d151858a9dcea1b9d999cdd23c201e9c12bcf3
7
- data.tar.gz: e45960eddf67527a28203e73c7805b14cdfd7fc0399fac5b18d99833ee1d9d054794d437fb30c69c1c6b405a910127d2118d1d8bc9a92839c9a28404ad9e4e2e
6
+ metadata.gz: d61e72abda5d75728bea4584482c75266edc5ed6631c1a2e35f2b923f007372120e635223fa932ba0dd4a54b6faff013f0f4f90651969a50925d53d5e6b15582
7
+ data.tar.gz: ba09ef47797160869d6f4f967e2b0907f062fe327a3e6da9c705a9a37b4e2f38759cf139d29792a3f715307ab0bf5fceed5717cb332fab57a66f1b158cd1d16a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bushpig (0.1.9)
4
+ bushpig (0.1.10.3)
5
5
  connection_pool (~> 2.2)
6
6
  json (>= 1.8)
7
7
  redis (~> 3.3)
data/gemset.nix CHANGED
@@ -186,7 +186,7 @@
186
186
  path = ./.;
187
187
  type = "path";
188
188
  };
189
- version = "0.1.9";
189
+ version = "0.1.10.3";
190
190
  };
191
191
  coderay = {
192
192
  groups = ["default" "development"];
data/lib/bushpig/job.rb CHANGED
@@ -30,8 +30,8 @@ module Bushpig
30
30
  JSON.generate({ class: self.class.name, id: job_id, args: each.to_a })
31
31
  end
32
32
 
33
- def call(job)
34
- self.class.job_handler.call(job)
33
+ def handle
34
+ self.class.job_handler.call(self)
35
35
  end
36
36
  end
37
37
  end
@@ -45,6 +45,10 @@ module Bushpig
45
45
  @job_handler
46
46
  end
47
47
 
48
+ def self.job_unique_key
49
+ @unique_key
50
+ end
51
+
48
52
  def job_id
49
53
  @job_id ||= SecureRandom.hex(32)
50
54
  end
@@ -54,7 +58,7 @@ module Bushpig
54
58
  end
55
59
 
56
60
  def job_key
57
- @unique_key.inject(Digest::SHA256.new) do |digest, key|
61
+ self.class.job_unique_key.inject(Digest::SHA256.new) do |digest, key|
58
62
  digest.update(self[key].to_s)
59
63
  end.hexdigest
60
64
  end
@@ -63,8 +67,8 @@ module Bushpig
63
67
  JSON.generate({ class: self.class.name, id: job_id, args: each.to_a })
64
68
  end
65
69
 
66
- def call(job)
67
- self.class.job_handler.call(job)
70
+ def handle
71
+ self.class.job_handler.call(self)
68
72
  end
69
73
  end
70
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bushpig
4
- VERSION = '0.1.9'
4
+ VERSION = '0.1.10.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bushpig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Sharples