doozer 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/doozer.gemspec +2 -2
- data/lib/doozer/scripts/cluster.rb +34 -7
- data/lib/doozer/scripts/migrate.rb +1 -1
- data/lib/doozer/version.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/doozer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{doozer}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["grippy"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-30}
|
13
13
|
s.default_executable = %q{doozer}
|
14
14
|
s.description = %q{This GEM provides a small, barebones framework for creating MVC Rack applications.}
|
15
15
|
s.email = %q{gmelton@whorde.com}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# script/cluster
|
7
7
|
# -C command (start || stop || restart || test)
|
8
8
|
# -E environment (default: development || deployment)
|
9
|
-
# -D (daemonize) - This is automatically initialized in deployment mode.
|
9
|
+
# -D (daemonize) - This is automatically initialized in deployment mode.
|
10
10
|
# -c config file - This is used to pass a config file for starting up unicorn
|
11
11
|
# -h Hellllpppp!!!
|
12
12
|
require 'optparse'
|
@@ -69,9 +69,7 @@ end
|
|
69
69
|
#
|
70
70
|
# See Unicorn::Configurator for more details => http://unicorn.bogomips.org/Unicorn/Configurator.html
|
71
71
|
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# See this page for details => http://unicorn.bogomips.org/SIGNALS.html
|
72
|
+
# See this page for supported signals => http://unicorn.bogomips.org/SIGNALS.html
|
75
73
|
def start_unicorn
|
76
74
|
puts "Starting unicorn..."
|
77
75
|
for app in @apps
|
@@ -90,6 +88,12 @@ def restart
|
|
90
88
|
start
|
91
89
|
end
|
92
90
|
|
91
|
+
# Calls stop_unicorn() and then start_unicorn()
|
92
|
+
def restart_unicorn
|
93
|
+
stop_unicorn
|
94
|
+
start_unicorn
|
95
|
+
end
|
96
|
+
|
93
97
|
# <b>development</b>: Only stops the first configured (if more then one) address:port
|
94
98
|
#
|
95
99
|
# <b>deployment</b>: Automatically stops all instances of your appserver for each defined cluster address:port
|
@@ -113,7 +117,30 @@ def stop
|
|
113
117
|
end
|
114
118
|
end
|
115
119
|
end
|
116
|
-
|
120
|
+
sleep(1)
|
121
|
+
system("ps -aux | grep rackup")
|
122
|
+
end
|
123
|
+
|
124
|
+
# <b>development</b>: Only stops the first configured (if more then one) address:port
|
125
|
+
#
|
126
|
+
# <b>deployment</b>: Automatically stops the first master process/cluster defined for address:port
|
127
|
+
def stop_unicorn
|
128
|
+
system("ps -aux | grep unicorn")
|
129
|
+
puts "Stoping unicorn..."
|
130
|
+
for app in @apps
|
131
|
+
if @env == :deployment
|
132
|
+
pid_file = "#{APP_PATH}/log/unicorn.pid"
|
133
|
+
puts "=> Reading pid from #{pid_file}"
|
134
|
+
if File.exist?(pid_file)
|
135
|
+
system("kill -QUIT `cat #{pid_file}`")
|
136
|
+
else
|
137
|
+
puts "ERROR => pid file doesn't exist"
|
138
|
+
end
|
139
|
+
end
|
140
|
+
break
|
141
|
+
end
|
142
|
+
sleep(1)
|
143
|
+
system("ps -aux | grep unicorn")
|
117
144
|
end
|
118
145
|
|
119
146
|
opts = OptionParser.new("", 24, ' ') { |opts|
|
@@ -144,9 +171,9 @@ case @command
|
|
144
171
|
when :start
|
145
172
|
@server != 'unicorn' ? start() : start_unicorn()
|
146
173
|
when :restart
|
147
|
-
restart()
|
174
|
+
@server != 'unicorn' ? restart() : restart_unicorn()
|
148
175
|
when :stop
|
149
|
-
stop()
|
176
|
+
@server != 'unicorn' ? stop() : stop_unicorn()
|
150
177
|
when :test
|
151
178
|
test()
|
152
179
|
end
|
@@ -84,7 +84,7 @@ raise "Missing Version and Direction in form of version:direction" if @version.n
|
|
84
84
|
Doozer::Initializer.boot(@env)
|
85
85
|
|
86
86
|
# need to grab all the current migrations. assumes there isn't a migration with 000_*_.rb
|
87
|
-
migrations = [nil].concat( Dir.glob(File.join(APP_PATH,'db/*_*.rb')) )
|
87
|
+
migrations = [nil].concat( Dir.glob(File.join(APP_PATH,'db/*_*.rb')).sort )
|
88
88
|
|
89
89
|
puts "Loading migration files..."
|
90
90
|
puts "=> Version: #{@version}"
|
data/lib/doozer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doozer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- grippy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-30 00:00:00 -07:00
|
13
13
|
default_executable: doozer
|
14
14
|
dependencies: []
|
15
15
|
|