Permalink
Browse files

Add #noscript_require to load noscript files

  • Loading branch information...
1 parent 8cc3da5 commit 75e34c868aa987755c66bc800344cc3dccb2fbfc @txus committed Jan 27, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −2 lib/noscript.rb
  2. +6 −0 lib/noscript/runtime.rb
View
@@ -13,8 +13,8 @@ module Noscript
CodeLoader.load_paths << File.expand_path('../noscript', __FILE__)
CodeLoader.load_paths << File.expand_path('../../', __FILE__)
- CodeLoader.run('kernel/traits')
- CodeLoader.run('kernel/test_case')
+ noscript_require('kernel/traits')
+ noscript_require('kernel/test_case')
def self.eval_noscript(code, *args)
file, line, binding, instance = '(eval)', 1, Runtime::Object.send(:binding), Runtime::Object
View
@@ -89,6 +89,12 @@ def method_missing(m, *args)
end
end
+module Kernel
+ def noscript_require(file)
+ Noscript::CodeLoader.run(file)
+ end
+end
+
class Module
def noscript_alias(noscript_name, ruby_name=nil)
Array(noscript_name).each do |noscript|

0 comments on commit 75e34c8

Please sign in to comment.