golden_brindle 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +1 -1
- data/golden_brindle.gemspec +6 -6
- data/lib/golden_brindle.rb +1 -0
- data/lib/golden_brindle/cluster.rb +14 -2
- data/lib/golden_brindle/configure.rb +2 -1
- data/lib/golden_brindle/const.rb +2 -2
- data/lib/golden_brindle/restart.rb +5 -8
- data/lib/golden_brindle/start.rb +7 -8
- data/lib/golden_brindle/stop.rb +4 -7
- metadata +45 -18
data/TODO
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Hack Unicorn to improve application gems checking
|
data/golden_brindle.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{golden_brindle}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Simonov"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-06}
|
13
13
|
s.default_executable = %q{golden_brindle}
|
14
14
|
s.description = %q{Unicorn HTTP server clustering tool like mongrel_cluster for Mongrel}
|
15
15
|
s.email = %q{alex@simonov.me}
|
@@ -45,18 +45,18 @@ Gem::Specification.new do |s|
|
|
45
45
|
s.homepage = %q{http://github.com/simonoff/golden_brindle}
|
46
46
|
s.rdoc_options = ["--charset=UTF-8"]
|
47
47
|
s.require_paths = ["lib"]
|
48
|
-
s.rubygems_version = %q{1.3.
|
48
|
+
s.rubygems_version = %q{1.3.7}
|
49
49
|
s.summary = %q{Unicorn HTTP server clustering tool like mongrel_cluster for Mongrel}
|
50
50
|
s.test_files = [
|
51
|
-
"test/
|
52
|
-
"test/
|
51
|
+
"test/test_golden_brindle.rb",
|
52
|
+
"test/helper.rb"
|
53
53
|
]
|
54
54
|
|
55
55
|
if s.respond_to? :specification_version then
|
56
56
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
57
57
|
s.specification_version = 3
|
58
58
|
|
59
|
-
if Gem::Version.new(Gem::
|
59
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
60
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
61
61
|
s.add_runtime_dependency(%q<gem_plugin>, [">= 0.2.3"])
|
62
62
|
s.add_runtime_dependency(%q<unicorn>, [">= 0.99"])
|
data/lib/golden_brindle.rb
CHANGED
@@ -11,8 +11,16 @@ module Cluster
|
|
11
11
|
]
|
12
12
|
end
|
13
13
|
|
14
|
+
def validate
|
15
|
+
@cwd = File.expand_path(@cwd)
|
16
|
+
valid_dir? @cwd, "Invalid path to golden_brindle configuration files: #@cwd"
|
17
|
+
return @valid
|
18
|
+
end
|
19
|
+
|
14
20
|
def run
|
15
21
|
command = self.class.to_s.downcase.split('::')[1]
|
22
|
+
counter = 0
|
23
|
+
errors = 0
|
16
24
|
Dir.chdir @cwd do
|
17
25
|
confs = Dir.glob("*.yml")
|
18
26
|
confs += Dir.glob("*.conf")
|
@@ -22,9 +30,13 @@ module Cluster
|
|
22
30
|
puts cmd if @verbose
|
23
31
|
output = `#{cmd}`
|
24
32
|
puts output if @verbose
|
25
|
-
|
33
|
+
status = $?.success?
|
34
|
+
puts "golden_brindle #{command} returned an error." unless status
|
35
|
+
counter += 1 if status
|
36
|
+
errors += 1 unless status
|
26
37
|
end
|
27
38
|
end
|
39
|
+
puts "Success:#{counter}; Errors: #{errors}"
|
28
40
|
end
|
29
41
|
|
30
42
|
end
|
@@ -42,4 +54,4 @@ module Cluster
|
|
42
54
|
include Cluster::Base
|
43
55
|
end
|
44
56
|
|
45
|
-
end
|
57
|
+
end
|
data/lib/golden_brindle/const.rb
CHANGED
@@ -22,22 +22,19 @@ module Brindle
|
|
22
22
|
end
|
23
23
|
|
24
24
|
@cwd = File.expand_path(@cwd)
|
25
|
-
valid_dir? @cwd, "Invalid path to
|
26
|
-
|
27
|
-
Dir.chdir @cwd
|
28
|
-
|
29
|
-
valid_exists? @pid_file, "PID file #@pid_file does not exist. Not running?"
|
25
|
+
valid_dir? @cwd, "Invalid path to application dir: #@cwd"
|
26
|
+
valid_exists? File.join(@cwd,@pid_file), "PID file #@pid_file does not exist. Not running?"
|
30
27
|
return @valid
|
31
28
|
end
|
32
29
|
|
33
30
|
def run
|
34
31
|
if @soft
|
35
|
-
GoldenBrindle::send_signal("HUP", @pid_file)
|
32
|
+
GoldenBrindle::send_signal("HUP", File.join(@cwd,@pid_file))
|
36
33
|
else
|
37
|
-
GoldenBrindle::send_signal("USR2", @pid_file)
|
34
|
+
GoldenBrindle::send_signal("USR2", File.join(@cwd,@pid_file))
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
41
38
|
end
|
42
39
|
|
43
|
-
end
|
40
|
+
end
|
data/lib/golden_brindle/start.rb
CHANGED
@@ -97,20 +97,18 @@ module Brindle
|
|
97
97
|
return false unless @valid
|
98
98
|
end
|
99
99
|
@cwd = File.expand_path(@cwd)
|
100
|
-
valid_dir? @cwd, "Invalid path to change to during daemon mode:
|
101
|
-
return false unless @valid
|
102
|
-
# Change there to start, then we'll have to come back after daemonize
|
103
|
-
Dir.chdir(@cwd)
|
104
|
-
|
100
|
+
valid_dir? @cwd, "Invalid path to change to during daemon mode: #{@cwd}"
|
105
101
|
valid?(@prefix[0] == ?/ && @prefix[-1] != ?/, "Prefix must begin with / and not end in /") if @prefix
|
106
|
-
valid_dir? File.dirname(@log_file), "Path to log file not valid:
|
107
|
-
valid_dir? File.dirname(@pid_file), "Path to pid file not valid:
|
102
|
+
valid_dir? File.dirname(File.join(@cwd,@log_file)), "Path to log file not valid: #{@log_file}"
|
103
|
+
valid_dir? File.dirname(File.join(@cwd,@pid_file)), "Path to pid file not valid: #{@pid_file}"
|
108
104
|
valid_user? @user if @user
|
109
105
|
valid_group? @group if @group
|
110
106
|
return @valid
|
111
107
|
end
|
112
108
|
|
113
109
|
def run
|
110
|
+
# Change there to start, then we'll have to come back after daemonize
|
111
|
+
Dir.chdir(@cwd)
|
114
112
|
options = { :listeners => []}
|
115
113
|
options[:pid] = @pid_file
|
116
114
|
options[:config_file] = @config_script
|
@@ -181,9 +179,10 @@ module Brindle
|
|
181
179
|
if @daemon
|
182
180
|
Unicorn::Launcher.daemonize!(options)
|
183
181
|
end
|
182
|
+
puts "start Unicorn..."
|
184
183
|
Unicorn.run(app, options)
|
185
184
|
end
|
186
185
|
|
187
186
|
|
188
187
|
end
|
189
|
-
end
|
188
|
+
end
|
data/lib/golden_brindle/stop.rb
CHANGED
@@ -16,22 +16,19 @@ module Brindle
|
|
16
16
|
def validate
|
17
17
|
if @config_file
|
18
18
|
valid_exists?(@config_file, "Config file not there: #@config_file")
|
19
|
-
return false unless @valid
|
20
19
|
@config_file = File.expand_path(@config_file)
|
21
20
|
load_config
|
22
|
-
return
|
21
|
+
return @valid
|
23
22
|
end
|
24
23
|
|
25
24
|
@cwd = File.expand_path(@cwd)
|
26
25
|
valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
|
27
|
-
|
28
|
-
Dir.chdir @cwd
|
29
|
-
|
30
|
-
valid_exists? @pid_file, "PID file #@pid_file does not exist. Not running?"
|
26
|
+
valid_exists? File.join(@cwd,@pid_file), "PID file #@pid_file does not exist. Not running?"
|
31
27
|
return @valid
|
32
28
|
end
|
33
29
|
|
34
30
|
def run
|
31
|
+
@pid_file = File.join(@cwd,@pid_file)
|
35
32
|
if @force
|
36
33
|
@wait.to_i.times do |waiting|
|
37
34
|
exit(0) if not File.exist? @pid_file
|
@@ -45,4 +42,4 @@ module Brindle
|
|
45
42
|
|
46
43
|
end
|
47
44
|
|
48
|
-
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: golden_brindle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Alexander Simonov
|
@@ -9,39 +15,54 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-06-06 00:00:00 +03:00
|
13
19
|
default_executable: golden_brindle
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: thoughtbot-shoulda
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: gem_plugin
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
30
40
|
requirements:
|
31
41
|
- - ">="
|
32
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 17
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 2
|
47
|
+
- 3
|
33
48
|
version: 0.2.3
|
34
|
-
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
35
51
|
- !ruby/object:Gem::Dependency
|
36
52
|
name: unicorn
|
37
|
-
|
38
|
-
|
39
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
40
56
|
requirements:
|
41
57
|
- - ">="
|
42
58
|
- !ruby/object:Gem::Version
|
59
|
+
hash: 205
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
- 99
|
43
63
|
version: "0.99"
|
44
|
-
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
45
66
|
description: Unicorn HTTP server clustering tool like mongrel_cluster for Mongrel
|
46
67
|
email: alex@simonov.me
|
47
68
|
executables:
|
@@ -84,24 +105,30 @@ rdoc_options:
|
|
84
105
|
require_paths:
|
85
106
|
- lib
|
86
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
87
109
|
requirements:
|
88
110
|
- - ">="
|
89
111
|
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
90
115
|
version: "0"
|
91
|
-
version:
|
92
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
93
118
|
requirements:
|
94
119
|
- - ">="
|
95
120
|
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
122
|
+
segments:
|
123
|
+
- 0
|
96
124
|
version: "0"
|
97
|
-
version:
|
98
125
|
requirements: []
|
99
126
|
|
100
127
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.3.
|
128
|
+
rubygems_version: 1.3.7
|
102
129
|
signing_key:
|
103
130
|
specification_version: 3
|
104
131
|
summary: Unicorn HTTP server clustering tool like mongrel_cluster for Mongrel
|
105
132
|
test_files:
|
106
|
-
- test/helper.rb
|
107
133
|
- test/test_golden_brindle.rb
|
134
|
+
- test/helper.rb
|