Module: Kernel::NanoKernel

Defined in:
lib/nanosys.rb

Overview

This module defines a new #require method and is appended to Object, allowing it to slip in prior to the original Kernel#require call.

Constant Summary collapse

FILE_ESC_RE =
%r{[^a-zA-Z_0-9./-]}

Instance Method Summary collapse

Instance Method Details

#require(fpath) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/nanosys.rb', line 12

def require( fpath )
  begin
    super( fpath )
  rescue LoadError => e
    epath = URI.escape( fpath , FILE_ESC_RE )
    raise e unless super( epath )
  end
end