golden_brindle 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'shoulda'
4
-
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'golden_brindle'
8
-
9
- class Test::Unit::TestCase
10
- end
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestGoldenBrindle < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- #flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end