From 54ec1c4fe81672ca66f327ef6ae170f458cd79e5 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 15 Aug 2007 20:57:30 +0000 Subject: sorry. I made wrong tags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_54@13009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_5/lib/irb/ext/loader.rb | 120 --------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 ruby_1_8_5/lib/irb/ext/loader.rb (limited to 'ruby_1_8_5/lib/irb/ext/loader.rb') diff --git a/ruby_1_8_5/lib/irb/ext/loader.rb b/ruby_1_8_5/lib/irb/ext/loader.rb deleted file mode 100644 index 67fdc31c8e..0000000000 --- a/ruby_1_8_5/lib/irb/ext/loader.rb +++ /dev/null @@ -1,120 +0,0 @@ -# -# loader.rb - -# $Release Version: 0.9.5$ -# $Revision: 1.1.2.1 $ -# $Date: 2005/04/19 19:24:58 $ -# by Keiju ISHITSUKA(keiju@ruby-lang.org) -# -# -- -# -# -# - - -module IRB - class LoadAbort < Exception;end - - module IrbLoader - @RCS_ID='-$Id: loader.rb,v 1.1.2.1 2005/04/19 19:24:58 keiju Exp $-' - - alias ruby_load load - alias ruby_require require - - def irb_load(fn, priv = nil) - path = search_file_from_ruby_path(fn) - raise LoadError, "No such file to load -- #{fn}" unless path - - load_file(path, priv) - end - - def search_file_from_ruby_path(fn) - if /^#{Regexp.quote(File::Separator)}/ =~ fn - return fn if File.exist?(fn) - return nil - end - - for path in $: - if File.exist?(f = File.join(path, fn)) - return f - end - end - return nil - end - - def source_file(path) - irb.suspend_name(path, File.basename(path)) do - irb.suspend_input_method(FileInputMethod.new(path)) do - |back_io| - irb.signal_status(:IN_LOAD) do - if back_io.kind_of?(FileInputMethod) - irb.eval_input - else - begin - irb.eval_input - rescue LoadAbort - print "load abort!!\n" - end - end - end - end - end - end - - def load_file(path, priv = nil) - irb.suspend_name(path, File.basename(path)) do - - if priv - ws = WorkSpace.new(Module.new) - else - ws = WorkSpace.new - end - irb.suspend_workspace(ws) do - irb.suspend_input_method(FileInputMethod.new(path)) do - |back_io| - irb.signal_status(:IN_LOAD) do -# p irb.conf - if back_io.kind_of?(FileInputMethod) - irb.eval_input - else - begin - irb.eval_input - rescue LoadAbort - print "load abort!!\n" - end - end - end - end - end - end - end - - def old - back_io = @io - back_path = @irb_path - back_name = @irb_name - back_scanner = @irb.scanner - begin - @io = FileInputMethod.new(path) - @irb_name = File.basename(path) - @irb_path = path - @irb.signal_status(:IN_LOAD) do - if back_io.kind_of?(FileInputMethod) - @irb.eval_input - else - begin - @irb.eval_input - rescue LoadAbort - print "load abort!!\n" - end - end - end - ensure - @io = back_io - @irb_name = back_name - @irb_path = back_path - @irb.scanner = back_scanner - end - end - end -end - -- cgit v1.2.3