summaryrefslogtreecommitdiffstats
path: root/lib/irb/input-method.rb
diff options
context:
space:
mode:
authorkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-13 15:27:09 +0000
committerkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-13 15:27:09 +0000
commiteef97c80fb197cf6c6bb14a2d0e80dc08d21fa5d (patch)
tree44dc0e11d46e0083f3f1b0a5b1789051f2b07e13 /lib/irb/input-method.rb
parentb40177f65544056461381229c672d9a8f3a9a389 (diff)
downloadruby-eef97c80fb197cf6c6bb14a2d0e80dc08d21fa5d.tar.gz
ruby-eef97c80fb197cf6c6bb14a2d0e80dc08d21fa5d.tar.xz
ruby-eef97c80fb197cf6c6bb14a2d0e80dc08d21fa5d.zip
* bin/irb lib/irb.rb lib/irb/...: IRB 0.9.5.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r--lib/irb/input-method.rb43
1 files changed, 3 insertions, 40 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index d1fc83a97..750add767 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -1,9 +1,9 @@
#
-# irb/input-method.rb - input methods using irb
-# $Release Version: 0.9$
+# irb/input-method.rb - input methods used irb
+# $Release Version: 0.9.5$
# $Revision$
# $Date$
-# by Keiju ISHITSUKA(keiju@ishitsuka.com)
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
@@ -85,49 +85,12 @@ module IRB
require "readline"
class ReadlineInputMethod < InputMethod
include Readline
-
- def ReadlineInputMethod.create_finalizer(hist, file)
- proc do
- if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
- if hf = IRB.conf[:HISTORY_FILE]
- file = File.expand_path(hf)
- end
- if file
- open(file, 'w' ) do |f|
- hist = hist.to_a
- f.puts(hist[-num..-1] || hist)
- end
- end
- end
- end
- end
-
def initialize
super
@line_no = 0
@line = []
@eof = false
-
- loader = proc {|f| f.each {|l| HISTORY << l.chomp}}
- if hist = IRB.conf[:HISTORY_FILE]
- hist = File.expand_path(hist)
- begin
- open(hist, &loader)
- rescue
- end
- else
- IRB.rc_files("_history") do |hist|
- begin
- open(hist, &loader)
- rescue
- hist = nil
- else
- break
- end
- end
- end
- ObjectSpace.define_finalizer(self, ReadlineInputMethod.create_finalizer(HISTORY, hist))
end
def gets