resque_spec 0.12.3 → 0.12.4

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.
data/README.md CHANGED
@@ -25,7 +25,7 @@ What is ResqueSpec?
25
25
  ===================
26
26
 
27
27
  ResqueSpec implements the *stable API* for Resque 1.19+ (which is `enqueue`,
28
- `enqueue_to`, `dequeue`, `peek`, `reserve`, the Resque hooks, and
28
+ `enqueue_to`, `dequeue`, `peek`, `reserve`, `size`, the Resque hooks, and
29
29
  because of the way `resque_scheduler` works `Job.create` and `Job.destroy`).
30
30
 
31
31
  It does not have a test double for Redis, so this may lead to some interesting and
@@ -346,6 +346,7 @@ Contributors
346
346
  * @avdgaag (Arjan van der Gaag) : peek support
347
347
  * @dtsiknis : Updated removed\_delayed
348
348
  * @lellisga (Li Ellis Gallardo) : fix inline/disable\_ext bug
349
+ * @jeffdeville (Jeff Deville) : Resque.size
349
350
 
350
351
  Copyright
351
352
  =========
@@ -33,6 +33,7 @@ module Resque
33
33
  alias :enqueue_to_without_resque_spec :enqueue_to if Resque.respond_to? :enqueue_to
34
34
  alias :reserve_without_resque_spec :reserve
35
35
  alias :peek_without_resque_spec :peek
36
+ alias :size_without_resque_spec :size
36
37
 
37
38
  def enqueue(klass, *args)
38
39
  return enqueue_without_resque_spec(klass, *args) if ResqueSpec.disable_ext
@@ -68,6 +69,12 @@ module Resque
68
69
  ResqueSpec.pop(queue_name)
69
70
  end
70
71
 
72
+ def size(queue_name)
73
+ return size_without_resque_spec(queue_name) if ResqueSpec.disable_ext
74
+
75
+ ResqueSpec.queue_by_name(queue_name).count
76
+ end
77
+
71
78
  private
72
79
 
73
80
  def run_after_enqueue(klass, *args)
@@ -1,3 +1,3 @@
1
1
  module ResqueSpec
2
- VERSION = "0.12.3"
2
+ VERSION = "0.12.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-28 00:00:00.000000000 Z
12
+ date: 2012-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: resque