Project

General

Profile

Actions

Bug #6338

closed

IRB.conf[:IRB_NAME] に依らず、サブ irb の irb_name が irb#<数字> になるのを修正する

Added by sho-h (Sho Hashimoto) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
Backport:
[ruby-dev:45543]

Description

るりまを書いている最中にサブ irb の irb_name が書き換わらない事に気づきました。.irbrc に IRB.conf[:IRB_NAME] = "bar" としてあったとして以下のように動作します。

$ irb
bar(main):001:0> irb
irb#1(main):001:0> conf.irb_name
=> "irb#1"
irb#1(main):003:0> IRB.conf[:IRB_NAME]
=> "bar"

バグであれば以下のようにすれば、上記は bar#1 が表示されるのではないかと思います。

--- lib/irb/context.rb (revision 35423)
+++ lib/irb/context.rb (working copy)
@@ -54,7 +54,7 @@
if IRB.conf[:SINGLE_IRB] or !defined?(JobManager)
@irb_name = IRB.conf[:IRB_NAME]
else

  •   @irb_name = "irb#"+IRB.JobManager.n_jobs.to_s
    
  •   @irb_name = IRB.conf[:IRB_NAME]+"#"+IRB.JobManager.n_jobs.to_s
     end
     @irb_path = "(" + @irb_name + ")"
    

意図通りなら reject してやってください。

Updated by mame (Yusuke Endoh) almost 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to keiju (Keiju Ishitsuka)
Actions #2

Updated by keiju (Keiju Ishitsuka) over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38622.
Sho, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/irb/context.rb: make a correct prompt from
    IRB.conf[:IRB_NAME] on irb [Bug #6338]. Patched by sho-h.
Actions

Also available in: Atom PDF

Like0
Like0Like0