restalk 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restalk.rb +6 -4
- metadata +1 -1
data/lib/restalk.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
class Restalk
|
4
2
|
class RestalkBeanstalkException < StandardError; end
|
5
3
|
|
6
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.3'
|
7
5
|
def initialize(adapter, server=nil, queue=nil)
|
8
6
|
extend BeanstalkAdapter if adapter == :beanstalk
|
9
7
|
extend ResqueAdapter if [:resque, :redis].include? adapter
|
10
8
|
init server, queue
|
11
9
|
end
|
12
10
|
|
13
|
-
def connected?
|
11
|
+
def self.connected?
|
14
12
|
!!@current_adapter
|
15
13
|
end
|
16
14
|
|
@@ -41,6 +39,8 @@ class Restalk
|
|
41
39
|
def stats
|
42
40
|
@beanstalk.stats
|
43
41
|
end
|
42
|
+
|
43
|
+
def connected?; true; end
|
44
44
|
end
|
45
45
|
|
46
46
|
module ResqueAdapter
|
@@ -63,6 +63,8 @@ class Restalk
|
|
63
63
|
Resque.info
|
64
64
|
end
|
65
65
|
|
66
|
+
def connected?; true; end
|
67
|
+
|
66
68
|
class RestalkResqueJob
|
67
69
|
attr_accessor :body
|
68
70
|
def initialize(data)
|