Skip to content
Browse files

Fix load paths to require the current directory

  • Loading branch information...
1 parent 92cc238 commit 5e90aa7eec33f011aabdd6d71f29df45cf1cba50 @txus committed Jan 27, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 kernel/test_case.nsc
  2. +1 −1 kernel/traits.nsc
  3. +1 −0 lib/noscript/code_loader.rb
  4. +4 −0 lib/noscript/runtime.rb
View
2 kernel/test_case.nsc
@@ -1,5 +1,5 @@
!RBIX
-962095474583808978
+2199918003027222139
0
M
1
View
2 kernel/traits.nsc
@@ -1,5 +1,5 @@
!RBIX
-962095474583808978
+2199918003027222139
0
M
1
View
1 lib/noscript/code_loader.rb
@@ -5,6 +5,7 @@ class CodeLoader
class << self
attr_reader :load_paths, :loaded_files
+ attr_writer :load_paths
def check_version?
Rubinius::CodeLoader.check_version
View
4 lib/noscript/runtime.rb
@@ -91,7 +91,11 @@ def method_missing(m, *args)
module Kernel
def noscript_require(file)
+ here = File.dirname(caller.first.split(":").first)
+ old_paths = Noscript::CodeLoader.load_paths
+ Noscript::CodeLoader.load_paths.unshift(here)
Noscript::CodeLoader.run(file)
+ Noscript::CodeLoader.load_paths = old_paths
end
end

0 comments on commit 5e90aa7

Please sign in to comment.
Something went wrong with that request. Please try again.