Module: Kernel

Defined in:
lib/polyglot.rb

Instance Method Summary collapse

Instance Method Details

#polyglot_original_requireObject



62
# File 'lib/polyglot.rb', line 62

alias polyglot_original_require require

#require(*a, &b) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/polyglot.rb', line 64

def require(*a, &b)
  polyglot_original_require(*a, &b)
rescue LoadError => load_error
  begin
    Polyglot.load(*a, &b)
  rescue Polyglot::NestedLoadError => e
    e.reraise
  rescue LoadError
    # Raise the original exception, possibly a MissingSourceFile with a path
    raise load_error
  end
end