lib/golden_brindle/start.rb in golden_brindle-0.0.1 vs lib/golden_brindle/start.rb in golden_brindle-0.0.2
- old
+ new
@@ -131,11 +131,11 @@
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
# trying to change user and group
begin
# check if something not set in config or cli
- unless @user.nil? || group.nil?
+ unless @user.nil? || @group.nil?
uid, gid = Process.euid, Process.egid
user, group = @user, @group
target_uid = Etc.getpwnam(user).uid
target_gid = Etc.getgrnam(group).gid
worker.tmp.chown(target_uid, target_gid)
@@ -144,11 +144,11 @@
Process::GID.change_privilege(target_gid)
Process::UID.change_privilege(target_uid)
end
end
rescue => e
- if RAILS_ENV == 'development'
+ if ENV['RAILS_ENV'] == 'development'
STDERR.puts "couldn't change user, oh well"
else
raise e
end
end
@@ -169,12 +169,12 @@
end_port ||= start_port + @servers.to_i - 1
(start_port..end_port).each do |port|
options[:listeners] << "#{@address}:#{port}"
end
end
- unless @listen.nil?
+ unless @listen.nil? || @listen.empty?
@listen.split(',').each do |listen|
- listen = File.join(@cwd,listen) if listen[0..0] != "/"
+ listen = File.join(@cwd,listen) if listen[0..0] != "/" && !listen.match(/\w+\:\w+/)
options[:listeners] << "#{listen}"
end
end
app = rails_builder(@daemon)
if @daemon
\ No newline at end of file