freelancing-god-riddle 0.9.8.1533.7 → 0.9.8.1533.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -0
- data/lib/riddle.rb +1 -1
- data/lib/riddle/controller.rb +17 -12
- metadata +2 -2
data/README.textile
CHANGED
data/lib/riddle.rb
CHANGED
@@ -18,7 +18,7 @@ module Riddle #:nodoc:
|
|
18
18
|
Rev = 1533
|
19
19
|
# Release number to mark my own fixes, beyond feature parity with
|
20
20
|
# Sphinx itself.
|
21
|
-
Release =
|
21
|
+
Release = 8
|
22
22
|
|
23
23
|
String = [Major, Minor, Tiny].join('.')
|
24
24
|
GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
|
data/lib/riddle/controller.rb
CHANGED
@@ -10,35 +10,40 @@ module Riddle
|
|
10
10
|
cmd << " --rotate" if running?
|
11
11
|
`#{cmd}`
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def start
|
15
15
|
return if running?
|
16
|
-
|
16
|
+
|
17
17
|
cmd = "searchd --pidfile --config #{@path}"
|
18
|
-
|
19
|
-
|
18
|
+
cmd = "start /B #{cmd}" if RUBY_PLATFORM =~ /mswin/
|
19
|
+
`#{cmd}`
|
20
|
+
|
20
21
|
sleep(1)
|
21
|
-
|
22
|
+
|
22
23
|
unless running?
|
23
24
|
puts "Failed to start searchd daemon. Check #{@configuration.searchd.log}."
|
24
25
|
end
|
25
26
|
end
|
26
|
-
|
27
|
+
|
27
28
|
def stop
|
28
29
|
return unless running?
|
29
|
-
|
30
|
+
Process.kill('SIGTERM', pid.to_i)
|
31
|
+
rescue Errno::EINVAL
|
32
|
+
Process.kill('SIGKILL', pid.to_i)
|
30
33
|
end
|
31
|
-
|
34
|
+
|
32
35
|
def pid
|
33
|
-
if File.exists?(
|
34
|
-
|
36
|
+
if File.exists?(@configuration.searchd.pid_file)
|
37
|
+
File.read(@configuration.searchd.pid_file)[/\d+/]
|
35
38
|
else
|
36
39
|
nil
|
37
40
|
end
|
38
41
|
end
|
39
|
-
|
42
|
+
|
40
43
|
def running?
|
41
|
-
pid &&
|
44
|
+
!!pid && !!Process.kill(0, pid.to_i)
|
45
|
+
rescue
|
46
|
+
false
|
42
47
|
end
|
43
48
|
end
|
44
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freelancing-god-riddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.8.1533.
|
4
|
+
version: 0.9.8.1533.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|