diff options
author | Michael Fellinger <m.fellinger@gmail.com> | 2009-06-05 20:39:17 +0900 |
---|---|---|
committer | Michael Fellinger <m.fellinger@gmail.com> | 2009-06-05 20:39:17 +0900 |
commit | 30b12906b89e9b7105927d7f81aabce0df40faa7 (patch) | |
tree | 0a435f0bd925b3274aade3ce5ca41793e2455e85 | |
parent | 10adb8bb192fdb3653becb21c08c1a78de3e8286 (diff) | |
download | rack-30b12906b89e9b7105927d7f81aabce0df40faa7.tar.gz |
Make sure that Reloader doesn't break when executed via ruby -e
-rw-r--r-- | lib/rack/reloader.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rack/reloader.rb b/lib/rack/reloader.rb index aa2f060b..a9c566f7 100644 --- a/lib/rack/reloader.rb +++ b/lib/rack/reloader.rb @@ -70,7 +70,7 @@ module Rack next if file =~ /\.(so|bundle)$/ # cannot reload compiled files found, stat = figure_path(file, paths) - next unless found and stat and mtime = stat.mtime + next unless found && stat && mtime = stat.mtime @cache[file] = found @@ -87,7 +87,7 @@ module Rack found, stat = safe_stat(found) return found, stat if found - paths.each do |possible_path| + paths.find do |possible_path| path = ::File.join(possible_path, file) found, stat = safe_stat(path) return ::File.expand_path(found), stat if found |