diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-19 19:24:59 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-19 19:24:59 +0000 |
commit | f9fb21448bc4c9b1d7e9fb135dc37593974a3498 (patch) | |
tree | 67e5782ca3ba385be9ecfe5ca6370c012fb36df6 /lib/irb/context.rb | |
parent | 40906c5d5d09837d005a7503fcf8c3f96cee111d (diff) |
* lib/irb.rb lib/irb/* doc/irb: IRB 0.9.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/context.rb')
-rw-r--r-- | lib/irb/context.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/irb/context.rb b/lib/irb/context.rb index 01856cd2e7..043c12ade5 100644 --- a/lib/irb/context.rb +++ b/lib/irb/context.rb @@ -1,9 +1,9 @@ # # irb/context.rb - irb context -# $Release Version: 0.9$ +# $Release Version: 0.9.5$ # $Revision$ # $Date$ -# by Keiju ISHITSUKA(keiju@ishitsuka.com) +# by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # @@ -19,7 +19,7 @@ module IRB # String -- File # other -- using this as InputMethod # - def initialize(irb, workspace = nil, input_method = nil) + def initialize(irb, workspace = nil, input_method = nil, output_method = nil) @irb = irb if workspace @workspace = workspace @@ -71,6 +71,13 @@ module IRB else @io = input_method end + self.save_history = IRB.conf[:SAVE_HISTORY] if IRB.conf[:SAVE_HISTORY] + + if output_method + @output_method = output_method + else + @output_method = StdioOutputMethod.new + end @verbose = IRB.conf[:VERBOSE] @echo = IRB.conf[:ECHO] @@ -96,13 +103,14 @@ module IRB attr_accessor :irb_name attr_accessor :irb_path - attr_accessor :use_readline + attr_reader :use_readline attr_reader :inspect_mode attr_reader :prompt_mode attr_accessor :prompt_i attr_accessor :prompt_s attr_accessor :prompt_c + attr_accessor :prompt_n attr_accessor :auto_indent_mode attr_accessor :return_format @@ -141,6 +149,7 @@ module IRB def set_last_value(value) @last_value = value + @workspace.evaluate self, "_ = IRB.CurrentContext.last_value" end attr_reader :irb_name @@ -151,6 +160,7 @@ module IRB @prompt_i = pconf[:PROMPT_I] @prompt_s = pconf[:PROMPT_S] @prompt_c = pconf[:PROMPT_C] + @prompt_n = pconf[:PROMPT_N] @return_format = pconf[:RETURN] if ai = pconf.include?(:AUTO_INDENT) @auto_indent_mode = ai @@ -177,7 +187,6 @@ module IRB @inspect_mode end - undef use_readline= def use_readline=(opt) @use_readline = opt print "use readline module\n" if @use_readline |