Module: MongoidSphinx
- Defined in:
- lib/mongoid_sphinx/version.rb,
lib/mongoid_sphinx.rb,
lib/mongoid_sphinx/delta.rb,
lib/mongoid_sphinx/index.rb,
lib/mongoid_sphinx/railtie.rb,
lib/mongoid_sphinx/configuration.rb
Overview
Defined Under Namespace
Modules: Delta
Classes: Configuration, Context, Index, Railtie
Constant Summary
collapse
- VERSION =
"0.1.4"
- @@sphinx_mutex =
Mutex.new
- @@context =
nil
Class Method Summary
collapse
Class Method Details
.context ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/mongoid_sphinx.rb', line 16
def self.context
if @@context.nil?
@@sphinx_mutex.synchronize do
if @@context.nil?
@@context = MongoidSphinx::Context.new
@@context.prepare
end
end
end
@@context
end
|
.pid_active?(pid) ⇒ Boolean
35
36
37
38
39
40
41
|
# File 'lib/mongoid_sphinx.rb', line 35
def self.pid_active?(pid)
!!Process.kill(0, pid.to_i)
rescue Errno::EPERM => e
true
rescue Exception => e
false
end
|
.reset_context! ⇒ Object
29
30
31
32
33
|
# File 'lib/mongoid_sphinx.rb', line 29
def self.reset_context!
@@sphinx_mutex.synchronize do
@@context = nil
end
end
|
.sphinx_running? ⇒ Boolean