Skip to content

Instantly share code, notes, and snippets.

@boffbowsh
Created November 21, 2009 23:11
Show Gist options
  • Select an option

  • Save boffbowsh/240330 to your computer and use it in GitHub Desktop.

Select an option

Save boffbowsh/240330 to your computer and use it in GitHub Desktop.
From d585c7a4753ce48d46e1ba44c5e5c831811ed864 Mon Sep 17 00:00:00 2001
From: Paul Bowsher <paul.bowsher@gmail.com>
Date: Sat, 21 Nov 2009 23:06:39 +0000
Subject: [PATCH] Fix issue #81
Check that the file is readable before attempting to require it
---
kernel/delta/requirer.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/kernel/delta/requirer.rb b/kernel/delta/requirer.rb
index 616daf1..212a0e0 100644
--- a/kernel/delta/requirer.rb
+++ b/kernel/delta/requirer.rb
@@ -187,6 +187,9 @@ class Requirer
end
end
+ # Check that the file is readable
+ raise LoadError, "File '#{rb_path}' is not readable" unless rb_stat.readable?
+
compile_feature(rb, requiring) do
cm = Rubinius::CompilerNG.compile_file_old(rb_path)
raise LoadError, "Unable to compile: #{rb_path}" unless cm
--
1.6.4.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment