Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add #noscript_require to load noscript files

  • Loading branch information...
commit 75e34c868aa987755c66bc800344cc3dccb2fbfc 1 parent 8cc3da5
Josep M. Bach authored January 27, 2012
4  lib/noscript.rb
@@ -13,8 +13,8 @@ module Noscript
13 13
 
14 14
   CodeLoader.load_paths << File.expand_path('../noscript', __FILE__)
15 15
   CodeLoader.load_paths << File.expand_path('../../', __FILE__)
16  
-  CodeLoader.run('kernel/traits')
17  
-  CodeLoader.run('kernel/test_case')
  16
+  noscript_require('kernel/traits')
  17
+  noscript_require('kernel/test_case')
18 18
 
19 19
   def self.eval_noscript(code, *args)
20 20
     file, line, binding, instance = '(eval)', 1, Runtime::Object.send(:binding), Runtime::Object
6  lib/noscript/runtime.rb
@@ -89,6 +89,12 @@ def method_missing(m, *args)
89 89
   end
90 90
 end
91 91
 
  92
+module Kernel
  93
+  def noscript_require(file)
  94
+    Noscript::CodeLoader.run(file)
  95
+  end
  96
+end
  97
+
92 98
 class Module
93 99
   def noscript_alias(noscript_name, ruby_name=nil)
94 100
     Array(noscript_name).each do |noscript|

0 notes on commit 75e34c8

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