resqueue-metadata 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,10 @@ module Resque
3
3
  class Metadata
4
4
  attr_reader :queue_name
5
5
 
6
+ def self.metadata_key queue_name
7
+ "metadata:#{queue_name}"
8
+ end
9
+
6
10
  def initialize queue_name
7
11
  self.queue_name = queue_name
8
12
  end
@@ -36,7 +40,7 @@ module Resque
36
40
  end
37
41
 
38
42
  def metadata_key
39
- "metadata:#{queue_name}"
43
+ self.class.metadata_key queue_name
40
44
  end
41
45
 
42
46
  end
@@ -0,0 +1,15 @@
1
+ # We have to monkey patch Resque directly to re-define the method. Including a module doesn't work.
2
+ module Resque
3
+ # Keep the old implementation around to call
4
+ alias_method :original_remove_queue, :remove_queue
5
+
6
+ # Given a queue name, completely deletes the queue and any associated metadata
7
+ def remove_queue name
8
+ # Let the default implementation remove the queue
9
+ original_return_value = original_remove_queue(name)
10
+ # And now remove the metadata for this queue
11
+ redis.del Resque::Queue::Metadata.metadata_key(name)
12
+ return original_return_value
13
+ end
14
+
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Resqueue
2
2
  module Metadata
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
File without changes
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resqueue-metadata
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 1
10
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Caius Durling
@@ -15,18 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-06-05 00:00:00 +01:00
17
+ date: 2011-08-23 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: resque
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
- hash: 3
30
27
  segments:
31
28
  - 0
32
29
  version: "0"
@@ -36,11 +33,9 @@ dependencies:
36
33
  name: redis-objects
37
34
  prerelease: false
38
35
  requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
36
  requirements:
41
37
  - - ">="
42
38
  - !ruby/object:Gem::Version
43
- hash: 3
44
39
  segments:
45
40
  - 0
46
41
  version: "0"
@@ -50,11 +45,9 @@ dependencies:
50
45
  name: rspec
51
46
  prerelease: false
52
47
  requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
48
  requirements:
55
49
  - - ">="
56
50
  - !ruby/object:Gem::Version
57
- hash: 3
58
51
  segments:
59
52
  - 0
60
53
  version: "0"
@@ -76,10 +69,12 @@ files:
76
69
  - Rakefile
77
70
  - lib/resqueue-metadata.rb
78
71
  - lib/resqueue-metadata/metadata.rb
72
+ - lib/resqueue-metadata/resque_extend.rb
79
73
  - lib/resqueue-metadata/version.rb
80
74
  - readme.md
81
75
  - resqueue-metadata.gemspec
82
76
  - spec/resqueue-metadata/metadata_spec.rb
77
+ - spec/resqueue-metadata/resque_extend.rb
83
78
  - spec/spec_helper.rb
84
79
  has_rdoc: true
85
80
  homepage: http://github.com/pizzapowered/resqueue-metadata
@@ -91,30 +86,27 @@ rdoc_options: []
91
86
  require_paths:
92
87
  - lib
93
88
  required_ruby_version: !ruby/object:Gem::Requirement
94
- none: false
95
89
  requirements:
96
90
  - - ">="
97
91
  - !ruby/object:Gem::Version
98
- hash: 3
99
92
  segments:
100
93
  - 0
101
94
  version: "0"
102
95
  required_rubygems_version: !ruby/object:Gem::Requirement
103
- none: false
104
96
  requirements:
105
97
  - - ">="
106
98
  - !ruby/object:Gem::Version
107
- hash: 3
108
99
  segments:
109
100
  - 0
110
101
  version: "0"
111
102
  requirements: []
112
103
 
113
104
  rubyforge_project:
114
- rubygems_version: 1.4.2
105
+ rubygems_version: 1.3.6
115
106
  signing_key:
116
107
  specification_version: 3
117
108
  summary: Lets you store metadata against your resque queues
118
109
  test_files:
119
110
  - spec/resqueue-metadata/metadata_spec.rb
111
+ - spec/resqueue-metadata/resque_extend.rb
120
112
  - spec/spec_helper.rb