diff options
author | Michael Fellinger <m.fellinger@gmail.com> | 2009-06-05 20:39:17 +0900 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2009-10-18 21:36:33 +0200 |
commit | 5c971306048cfa62d3fbce091437bedef0b616ec (patch) | |
tree | c9e20c1f002924ddc2ed9a0d889db2edc893f3aa | |
parent | ba5a5224d9f386499ef35fd69f274fa636c7428e (diff) | |
download | rack-5c971306048cfa62d3fbce091437bedef0b616ec.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 |