Skip to content

Commit

Permalink
fix some realpath issue with missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Feb 28, 2010
1 parent 015ac64 commit 265d6ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/sinatra/reloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ def self.register(route)
end

def self.new(file)
return nil unless File.exist? file
@map[file.realpath] ||= super
file = file.expand_path
begin
file = file.realpath
rescue Errno::ENOENT
end
@map[file] ||= super
end

class << self
Expand Down Expand Up @@ -74,6 +78,7 @@ def dont_reload(*files)
files.flatten.each do |file|
# Rubinius and JRuby ignore block passed to glob.
Dir.glob(file).each { |f| FileWatcher[f].dont_reload! dont }
FileWatcher[file].dont_reload! dont
end
end

Expand Down

0 comments on commit 265d6ad

Please sign in to comment.