Skip to content

Commit

Permalink
Tweaking Hydra::TestingServer to ensure tmp/pids directory exists to …
Browse files Browse the repository at this point in the history
…eliminate error on rake hydra:default_fixtures:load.
  • Loading branch information
John Scofield committed Sep 16, 2010
1 parent 0f47c20 commit 9070318
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions vendor/plugins/hydra_repository/lib/hydra/testing_server.rb
Expand Up @@ -83,10 +83,11 @@ def start
Dir.chdir(@jetty_home) do
self.send "#{platform}_process".to_sym
end
mkpath(pid_dir) unless File.directory?(pid_dir)
begin
f = File.new(pid_path, "w+")
f = File.new(pid_path, "w")
rescue Errno::ENOENT, Errno::EACCES
f = File.new(File.join('tmp',pid_file))
f = File.new(File.join(Rails.root,'tmp',pid_file),"w")
end
f.puts "#{@pid}"
f.close
Expand Down Expand Up @@ -155,8 +156,6 @@ def pid
@pid || File.open( pid_path ) { |f| return f.gets.to_i } if File.exist?(pid_path)
end



end

#
Expand Down

0 comments on commit 9070318

Please sign in to comment.