summary refs log tree commit
diff options
context:
space:
mode:
authorMichael Fellinger <m.fellinger@gmail.com>2009-06-05 20:39:17 +0900
committerMichael Fellinger <m.fellinger@gmail.com>2009-06-05 20:39:17 +0900
commit30b12906b89e9b7105927d7f81aabce0df40faa7 (patch)
tree0a435f0bd925b3274aade3ce5ca41793e2455e85
parent10adb8bb192fdb3653becb21c08c1a78de3e8286 (diff)
downloadrack-30b12906b89e9b7105927d7f81aabce0df40faa7.tar.gz
Make sure that Reloader doesn't break when executed via ruby -e
-rw-r--r--lib/rack/reloader.rb4
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