Permalink
Browse files

Check to see if the file exists before trying to open it

  • Loading branch information...
1 parent 82e642f commit 0ce96e3d32bb7b1c088d16f85bfa524114eba955 HD Moore committed Nov 21, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/fastlib.rb
View
@@ -98,7 +98,7 @@ def fastlib_already_tried?(name)
#
class FastLib
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
@@cache = {}
@@ -141,6 +141,9 @@ def self.load(lib, name, noprocess=false)
def self.load_cache(lib)
return if @@cache[lib]
dict = {}
+
+ return if not ::File.exists?(lib)
+
::File.open(lib, 'rb') do |fd|
head = fd.read(4)
return if head != "FAST"

0 comments on commit 0ce96e3

Please sign in to comment.