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/input-method.rb | 120 ------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 ruby_1_8_5/lib/irb/input-method.rb (limited to 'ruby_1_8_5/lib/irb/input-method.rb') diff --git a/ruby_1_8_5/lib/irb/input-method.rb b/ruby_1_8_5/lib/irb/input-method.rb deleted file mode 100644 index d6abadba76..0000000000 --- a/ruby_1_8_5/lib/irb/input-method.rb +++ /dev/null @@ -1,120 +0,0 @@ -# -# irb/input-method.rb - input methods used irb -# $Release Version: 0.9.5$ -# $Revision: 1.4.2.2 $ -# $Date: 2005/05/25 13:53:41 $ -# by Keiju ISHITSUKA(keiju@ruby-lang.org) -# -# -- -# -# -# -module IRB - # - # InputMethod - # StdioInputMethod - # FileInputMethod - # (ReadlineInputMethod) - # - STDIN_FILE_NAME = "(line)" - class InputMethod - @RCS_ID='-$Id: input-method.rb,v 1.4.2.2 2005/05/25 13:53:41 shugo Exp $-' - - def initialize(file = STDIN_FILE_NAME) - @file_name = file - end - attr_reader :file_name - - attr_accessor :prompt - - def gets - IRB.fail NotImplementedError, "gets" - end - public :gets - - def readable_atfer_eof? - false - end - end - - class StdioInputMethod < InputMethod - def initialize - super - @line_no = 0 - @line = [] - end - - def gets - print @prompt - @line[@line_no += 1] = $stdin.gets - end - - def eof? - $stdin.eof? - end - - def readable_atfer_eof? - true - end - - def line(line_no) - @line[line_no] - end - end - - class FileInputMethod < InputMethod - def initialize(file) - super - @io = open(file) - end - attr_reader :file_name - - def eof? - @io.eof? - end - - def gets - print @prompt - l = @io.gets -# print @prompt, l - l - end - end - - begin - require "readline" - class ReadlineInputMethod < InputMethod - include Readline - def initialize - super - - @line_no = 0 - @line = [] - @eof = false - end - - def gets - if l = readline(@prompt, false) - HISTORY.push(l) if !l.empty? - @line[@line_no += 1] = l + "\n" - else - @eof = true - l - end - end - - def eof? - @eof - end - - def readable_atfer_eof? - true - end - - def line(line_no) - @line[line_no] - end - end - rescue LoadError - end -end -- cgit v1.2.3