dango 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dango/script/dango_server.rb +34 -25
- data/lib/dango/tasks/dango_rake.rb +3 -2
- data/lib/dango/version.rb +1 -1
- metadata +2 -2
@@ -11,29 +11,38 @@ require 'dango/server_framework'
|
|
11
11
|
require RAILS_ROOT + '/config/environment'
|
12
12
|
|
13
13
|
class ScriptDangoServer
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
14
|
+
def initialize(config = {}, start_options = {})
|
15
|
+
# コマンドラインオプションでconfigを上書きする
|
16
|
+
start_options.each do |k, v|
|
17
|
+
k =~ /\-\-(\w+?):(\w+?)$/
|
18
|
+
key1 = Regexp.last_match(1)
|
19
|
+
key2 = Regexp.last_match(2)
|
20
|
+
|
21
|
+
value = v.dup
|
22
|
+
value = true if v == 'true'
|
23
|
+
value = false if v == 'false'
|
24
|
+
|
25
|
+
if key1 && key2
|
26
|
+
config[key1][key2] = value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# daemonモードで起動 (nochdir=true)
|
31
|
+
Process.daemon(true) if config['server']['daemon']
|
32
|
+
|
33
|
+
# serverファイル名一覧を取得
|
34
|
+
load_files = []
|
35
|
+
glob_str = 'dango/server/*.rb'
|
36
|
+
Dir.glob(glob_str) do |srv_file|
|
37
|
+
load_files.push({:file=>srv_file, :mtime=>File.mtime(srv_file)})
|
38
|
+
end
|
39
|
+
|
40
|
+
# ファイル名順にソート
|
41
|
+
load_files = load_files.sort_by{|f| f[:file] }
|
42
|
+
load_files.each do |f|
|
43
|
+
load f[:file]
|
44
|
+
end
|
45
|
+
|
46
|
+
DangoServer.start(config)
|
47
|
+
end
|
39
48
|
end
|
@@ -13,7 +13,7 @@ end
|
|
13
13
|
# pid保存ファイルの読み出し
|
14
14
|
def get_dango_pid()
|
15
15
|
begin
|
16
|
-
pid = open("tmp/pids/dango.pid", "rb"){|fh| fh.read }.to_i
|
16
|
+
pid = open("tmp/pids/dango.#{ENV['RAILS_ENV']}.pid", "rb"){|fh| fh.read }.to_i
|
17
17
|
rescue
|
18
18
|
pid = nil
|
19
19
|
end
|
@@ -82,7 +82,8 @@ def stop_process(pid)
|
|
82
82
|
end
|
83
83
|
|
84
84
|
else ## i386-mswin32以外
|
85
|
-
system("kill -9 #{pid}")
|
85
|
+
# system("kill -9 #{pid}")
|
86
|
+
system("kill #{pid}")
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
data/lib/dango/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dango
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keisuke Minami
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-07-
|
12
|
+
date: 2008-07-29 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|