sucker_punch 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/sucker_punch/testing.rb +44 -0
- data/lib/sucker_punch/version.rb +1 -1
- data/sucker_punch.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4da8e31976d1d287c875ac707116b36a4d80b38ed944d71912de088f6b90b02
|
4
|
+
data.tar.gz: f95f0efc985a0bbbed2392b713ae8dda2dfac0a0e701bdf06dc4bb25ab6e371c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f318e445d227d77c4237692bb96f37385321ac79ca34b14c2b0de8f87058dbd7f6ff53fd3b9b7db460f77606369172faff291fa49152635c5641a29de2ef8703
|
7
|
+
data.tar.gz: c6b54fd3541a8efecdc2a83ae54fcf3c8f3f6a7cb0a84a737a87f9446025f2241403dc10300d60fac531ea9696e941efded93a365070f1e539a986fb262ccadd
|
data/CHANGES.md
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'sucker_punch'
|
2
|
+
|
3
|
+
# Include this in your tests to simulate
|
4
|
+
# a fake job queue. Jobs won't be executed
|
5
|
+
# as they normal would be the thread pool.
|
6
|
+
# They'll instead be pushed to a fake queue
|
7
|
+
# to be checked in a test environment.
|
8
|
+
#
|
9
|
+
# Include in your test_helper.rb:
|
10
|
+
#
|
11
|
+
# require 'sucker_punch/testing'
|
12
|
+
#
|
13
|
+
# In your application code:
|
14
|
+
#
|
15
|
+
# LogJob.perform_async(1, 2, 3)
|
16
|
+
#
|
17
|
+
# In your tests:
|
18
|
+
#
|
19
|
+
# LogJob.jobs => [{ "args" => [1, 2, 3]]
|
20
|
+
|
21
|
+
module SuckerPunch
|
22
|
+
module Job
|
23
|
+
def self.jobs
|
24
|
+
SuckerPunch::Queue.find_or_create(self.to_s)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.clear_all
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class Queue
|
33
|
+
def self.find_or_create(name, number_workers = 2)
|
34
|
+
QUEUES.fetch_or_store(name) do
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def kill
|
41
|
+
true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/sucker_punch/version.rb
CHANGED
data/sucker_punch.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sucker_punch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hilkert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0
|
68
|
+
version: '1.0'
|
69
69
|
description: Asynchronous processing library for Ruby
|
70
70
|
email:
|
71
71
|
- brandonhilkert@gmail.com
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/sucker_punch/job.rb
|
90
90
|
- lib/sucker_punch/queue.rb
|
91
91
|
- lib/sucker_punch/railtie.rb
|
92
|
+
- lib/sucker_punch/testing.rb
|
92
93
|
- lib/sucker_punch/testing/inline.rb
|
93
94
|
- lib/sucker_punch/version.rb
|
94
95
|
- sucker_punch.gemspec
|