diff options
-rw-r--r-- | lib/irb/locale.rb | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb index 7615a4e8d8..f94aa0f40b 100644 --- a/lib/irb/locale.rb +++ b/lib/irb/locale.rb @@ -82,39 +82,12 @@ module IRB # :nodoc: super(*ary) end - def require(file, priv = nil) - rex = Regexp.new("lc/#{Regexp.quote(file)}\.(so|o|sl|rb)?") - return false if $".find{|f| f =~ rex} - - case file - when /\.rb$/ - begin - load(file, priv) - $".push file - return true - rescue LoadError - end - when /\.(so|o|sl)$/ - return super - end - - begin - load(f = file + ".rb") - $".push f #" - return true - rescue LoadError - return ruby_require(file) - end - end - - alias toplevel_load load - - def load(file, priv=nil) + def load(file) found = find(file) if found unless @@loaded.include?(found) @@loaded << found # cache - return real_load(found, priv) + Kernel.load(found) end else raise LoadError, "No such file to load -- #{file}" @@ -133,16 +106,6 @@ module IRB # :nodoc: end end - private - def real_load(path, priv) - src = MagicFile.open(path){|f| f.read} - if priv - eval("self", TOPLEVEL_BINDING).extend(Module.new {eval(src, nil, path)}) - else - eval(src, TOPLEVEL_BINDING, path) - end - end - # @param paths load paths in which IRB find a localized file. # @param dir directory # @param file basename to be localized |