bushpig 0.1.9 → 0.1.10.3
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/Gemfile.lock +1 -1
- data/gemset.nix +1 -1
- data/lib/bushpig/job.rb +9 -5
- data/lib/bushpig/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1efcbe37d7ae873706796ef83eacb28e8eaa8146c4f2a11059047d8720a46178
|
4
|
+
data.tar.gz: eed134f3dd8c22f164ae7033ce0b9268ce4c5e7afba581985bc4cb0a71cc31f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d61e72abda5d75728bea4584482c75266edc5ed6631c1a2e35f2b923f007372120e635223fa932ba0dd4a54b6faff013f0f4f90651969a50925d53d5e6b15582
|
7
|
+
data.tar.gz: ba09ef47797160869d6f4f967e2b0907f062fe327a3e6da9c705a9a37b4e2f38759cf139d29792a3f715307ab0bf5fceed5717cb332fab57a66f1b158cd1d16a
|
data/Gemfile.lock
CHANGED
data/gemset.nix
CHANGED
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
|
34
|
-
self.class.job_handler.call(
|
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
|
-
|
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
|
67
|
-
self.class.job_handler.call(
|
70
|
+
def handle
|
71
|
+
self.class.job_handler.call(self)
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
data/lib/bushpig/version.rb
CHANGED