module NPGRT::Require
Constants
- ADDPATH
Public Instance Methods
binary_forms(a)
click to toggle source
# File lib/npgrt/require.rb, line 11 def binary_forms(a) w = NPGRT::PlatformWidth.to_s [ a, a+".dll", a+".so", File.basename(a) + "_" + w + File.extname(a), File.basename(a) + "_" + w + ".dll", File.basename(a) + "_" + w + ".so" ] end
require(a) { |x| ... }
click to toggle source
Calls superclass method
# File lib/npgrt/require.rb, line 3 def require(a) path = Gem.find_files(a) path.each{|x| yield x} super a end
Also aliased as: primitive_require
require_binary(a)
click to toggle source
# File lib/npgrt/require.rb, line 20 def require_binary(a) path = binary_forms(a).inject([]){|ret, v| ret.concat Gem.find_files v } v = path.map{|x| FileTest.file?(x) ? NPGRT.normalize_pathsep_os(File.dirname(x)) : nil }.compact - ADDPATH ENV['path'] += ";" + v.join(";") ADDPATH.concat v end
Private Instance Methods
try_build(dir)
click to toggle source
# File lib/npgrt/require.rb, line 42 def try_build(dir) dir = File.dirname dir if FileTest.file?(dir) system "cmd /c \"cd /d #{dir} & rake npgrt:build\"" end