Module: Bushpig
- Defined in:
- lib/bushpig.rb,
lib/bushpig/cli.rb,
lib/bushpig/job.rb,
lib/bushpig/client.rb,
lib/bushpig/server.rb,
lib/bushpig/testing.rb,
lib/bushpig/version.rb,
lib/bushpig/redis_pool.rb
Defined Under Namespace
Modules: Job, Testing
Classes: CLI, Client, RedisPool, Server
Constant Summary
collapse
- NAME =
'Bushpig'
- LICENSE =
'See LICENSE and the MIT License for licensing details.'
- VERSION =
'0.1.15'
Class Method Summary
collapse
Class Method Details
.client ⇒ Object
15
16
17
18
19
|
# File 'lib/bushpig.rb', line 15
def self.client
raise 'Bushpig client not configured' unless @client
@client
end
|
.client=(client) ⇒ Object
21
22
23
|
# File 'lib/bushpig.rb', line 21
def self.client=(client)
@client = client
end
|
47
48
49
|
# File 'lib/bushpig.rb', line 47
def self.configure_client
yield self unless server?
end
|
43
44
45
|
# File 'lib/bushpig.rb', line 43
def self.configure_server
yield self if server?
end
|
.job_key(job_key) ⇒ Object
59
60
61
|
# File 'lib/bushpig.rb', line 59
def self.job_key(job_key)
"job:#{job_key}"
end
|
.queue_key(queue) ⇒ Object
55
56
57
|
# File 'lib/bushpig.rb', line 55
def self.queue_key(queue)
"set:#{queue}"
end
|
.server ⇒ Object
25
26
27
28
29
|
# File 'lib/bushpig.rb', line 25
def self.server
raise 'Bushpig server not configured' unless @server
@server
end
|
.server=(server) ⇒ Object
31
32
33
|
# File 'lib/bushpig.rb', line 31
def self.server=(server)
@server = server
end
|
.server? ⇒ Boolean
51
52
53
|
# File 'lib/bushpig.rb', line 51
def self.server?
defined?(Bushpig::CLI)
end
|
.testing ⇒ Object
35
36
37
|
# File 'lib/bushpig.rb', line 35
def self.testing
@testing ||= false
end
|
.testing=(testing) ⇒ Object
39
40
41
|
# File 'lib/bushpig.rb', line 39
def self.testing=(testing)
@testing = testing
end
|