heel 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +5 -0
- data/lib/heel/server.rb +14 -9
- data/lib/heel/version.rb +1 -1
- metadata +1 -1
data/CHANGES
CHANGED
data/lib/heel/server.rb
CHANGED
@@ -183,23 +183,28 @@ module Heel
|
|
183
183
|
merge_options
|
184
184
|
setup_heel_dir
|
185
185
|
|
186
|
-
|
187
|
-
|
186
|
+
# capture method/variables into a local context so they can be used inside the Configurator block
|
187
|
+
c_document_root = options.document_root
|
188
|
+
c_background_me = options.daemonize
|
189
|
+
c_default_dir = default_directory
|
190
|
+
c_pid_file = pid_file
|
191
|
+
c_log_file = log_file
|
192
|
+
|
188
193
|
stats = ::Mongrel::StatisticsFilter.new(:sample_rate => 1)
|
189
|
-
config = ::Mongrel::Configurator.new
|
190
|
-
if
|
191
|
-
if File.exists?(
|
192
|
-
log "ERROR: PID File #{
|
193
|
-
log "ERROR: Check the Log file #{
|
194
|
+
config = ::Mongrel::Configurator.new(:host => options.address, :port => options.port, :pid_file => c_pid_file) do
|
195
|
+
if c_background_me then
|
196
|
+
if File.exists?(c_pid_file) then
|
197
|
+
log "ERROR: PID File #{c_pid_file} already exists. Heel may already be running."
|
198
|
+
log "ERROR: Check the Log file #{c_log_file}"
|
194
199
|
log "ERROR: Heel will not start until the .pid file is cleared."
|
195
200
|
exit 1
|
196
201
|
end
|
197
|
-
daemonize({:cwd =>
|
202
|
+
daemonize({:cwd => c_default_dir, :log_file => c_log_file})
|
198
203
|
end
|
199
204
|
|
200
205
|
listener do
|
201
206
|
uri "/", :handler => stats
|
202
|
-
uri "/", :handler => Heel::DirHandler.new({:document_root =>
|
207
|
+
uri "/", :handler => Heel::DirHandler.new({:document_root => c_document_root})
|
203
208
|
uri "/", :handler => Heel::ErrorHandler.new
|
204
209
|
uri "/icons", :handler => Heel::DirHandler.new({ :document_root =>
|
205
210
|
File.join(APP_RESOURCE_DIR, "famfamfam", "icons")})
|
data/lib/heel/version.rb
CHANGED