golden_brindle 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +38 -0
- data/Rakefile +33 -46
- data/bin/golden_brindle +1 -4
- data/golden_brindle.gemspec +33 -15
- data/lib/golden_brindle/actions/cluster.rb +50 -0
- data/lib/golden_brindle/actions/configure.rb +63 -0
- data/lib/golden_brindle/actions/restart.rb +40 -0
- data/lib/golden_brindle/actions/start.rb +131 -0
- data/lib/golden_brindle/actions/stop.rb +45 -0
- data/lib/golden_brindle/base.rb +89 -0
- data/lib/golden_brindle/command.rb +39 -174
- data/lib/golden_brindle/const.rb +5 -5
- data/lib/golden_brindle/hooks.rb +2 -1
- data/lib/golden_brindle/rails_support.rb +2 -2
- data/lib/golden_brindle/validations.rb +56 -0
- data/lib/golden_brindle.rb +6 -7
- data/spec/golden_brindle_spec.rb +23 -0
- data/spec/spec_helper.rb +12 -0
- metadata +70 -18
- data/lib/golden_brindle/cluster.rb +0 -53
- data/lib/golden_brindle/configure.rb +0 -63
- data/lib/golden_brindle/restart.rb +0 -40
- data/lib/golden_brindle/start.rb +0 -130
- data/lib/golden_brindle/stop.rb +0 -45
- data/test/helper.rb +0 -10
- data/test/test_golden_brindle.rb +0 -7
data/lib/golden_brindle/stop.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
module Brindle
|
2
|
-
|
3
|
-
class Stop < GemPlugin::Plugin "/commands"
|
4
|
-
include GoldenBrindle::Command::Base
|
5
|
-
|
6
|
-
def configure
|
7
|
-
options [
|
8
|
-
['-c', '--chdir PATH', "Change to dir before starting (will be expanded).", :@cwd, "."],
|
9
|
-
['-C', '--config PATH', "Use a mongrel based config file", :@config_file, nil],
|
10
|
-
['-f', '--force', "Force the shutdown (kill -9).", :@force, false],
|
11
|
-
['-w', '--wait SECONDS', "Wait SECONDS before forcing shutdown", :@wait, "0"],
|
12
|
-
['-P', '--pid FILE', "Where the PID file is located.", :@pid_file, "tmp/pids/unicorn.pid"]
|
13
|
-
]
|
14
|
-
end
|
15
|
-
|
16
|
-
def validate
|
17
|
-
if @config_file
|
18
|
-
valid_exists?(@config_file, "Config file not there: #@config_file")
|
19
|
-
@config_file = File.expand_path(@config_file)
|
20
|
-
load_config
|
21
|
-
return @valid
|
22
|
-
end
|
23
|
-
|
24
|
-
@cwd = File.expand_path(@cwd)
|
25
|
-
valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
|
26
|
-
valid_exists? File.join(@cwd,@pid_file), "PID file #@pid_file does not exist. Not running?"
|
27
|
-
return @valid
|
28
|
-
end
|
29
|
-
|
30
|
-
def run
|
31
|
-
@pid_file = File.join(@cwd,@pid_file)
|
32
|
-
if @force
|
33
|
-
@wait.to_i.times do |waiting|
|
34
|
-
exit(0) if not File.exist? @pid_file
|
35
|
-
sleep 1
|
36
|
-
end
|
37
|
-
GoldenBrindle::send_signal("KILL", @pid_file) if File.exist? @pid_file
|
38
|
-
else
|
39
|
-
GoldenBrindle::send_signal("TERM", @pid_file)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
data/test/helper.rb
DELETED
data/test/test_golden_brindle.rb
DELETED