[ruby/irb] Remove unused PROMPT_N

(https://github.com/ruby/irb/pull/685)

https://github.com/ruby/irb/commit/66e69fa0dc
This commit is contained in:
Summer ☀️ 2023-08-20 04:09:50 -06:00 committed by Hiroshi SHIBATA
parent 9126dd4b0e
commit 0cd92819c9
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
7 changed files with 7 additions and 36 deletions

View File

@ -125,7 +125,6 @@ irb起動時に``~/.irbrc''を読み込みます. もし存在しない場合は
IRB.conf[:PROMPT][:MY_PROMPT] = { # プロンプトモードの名前 IRB.conf[:PROMPT][:MY_PROMPT] = { # プロンプトモードの名前
:PROMPT_I => nil, # 通常のプロンプト :PROMPT_I => nil, # 通常のプロンプト
:PROMPT_N => nil, # 継続行のプロンプト
:PROMPT_S => nil, # 文字列などの継続行のプロンプト :PROMPT_S => nil, # 文字列などの継続行のプロンプト
:PROMPT_C => nil, # 式が継続している時のプロンプト :PROMPT_C => nil, # 式が継続している時のプロンプト
:RETURN => " ==>%s\n" # リターン時のプロンプト :RETURN => " ==>%s\n" # リターン時のプロンプト
@ -140,7 +139,7 @@ OKです.
IRB.conf[:PROMPT_MODE] = :MY_PROMPT IRB.conf[:PROMPT_MODE] = :MY_PROMPT
PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_Cは, フォーマットを指定します. PROMPT_I, PROMPT_S, PROMPT_Cは, フォーマットを指定します.
%N 起動しているコマンド名が出力される. %N 起動しているコマンド名が出力される.
%m mainオブジェクト(self)がto_sで出力される. %m mainオブジェクト(self)がto_sで出力される.
@ -155,7 +154,6 @@ PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_Cは, フォーマットを指定します.
IRB.conf[:PROMPT][:DEFAULT] = { IRB.conf[:PROMPT][:DEFAULT] = {
:PROMPT_I => "%N(%m):%03n:%i> ", :PROMPT_I => "%N(%m):%03n:%i> ",
:PROMPT_N => "%N(%m):%03n:%i> ",
:PROMPT_S => "%N(%m):%03n:%i%l ", :PROMPT_S => "%N(%m):%03n:%i%l ",
:PROMPT_C => "%N(%m):%03n:%i* ", :PROMPT_C => "%N(%m):%03n:%i* ",
:RETURN => "=> %s\n" :RETURN => "=> %s\n"

View File

@ -197,7 +197,6 @@ require_relative "irb/debug"
# #
# IRB.conf[:PROMPT_MODE][:DEFAULT] = { # IRB.conf[:PROMPT_MODE][:DEFAULT] = {
# :PROMPT_I => "%N(%m):%03n> ", # :PROMPT_I => "%N(%m):%03n> ",
# :PROMPT_N => "%N(%m):%03n> ",
# :PROMPT_S => "%N(%m):%03n%l ", # :PROMPT_S => "%N(%m):%03n%l ",
# :PROMPT_C => "%N(%m):%03n* ", # :PROMPT_C => "%N(%m):%03n* ",
# :RETURN => "%s\n" # used to printf # :RETURN => "%s\n" # used to printf
@ -207,35 +206,30 @@ require_relative "irb/debug"
# #
# # :NULL: # # :NULL:
# # :PROMPT_I: # # :PROMPT_I:
# # :PROMPT_N:
# # :PROMPT_S: # # :PROMPT_S:
# # :PROMPT_C: # # :PROMPT_C:
# # :RETURN: | # # :RETURN: |
# # %s # # %s
# # :DEFAULT: # # :DEFAULT:
# # :PROMPT_I: ! '%N(%m):%03n> ' # # :PROMPT_I: ! '%N(%m):%03n> '
# # :PROMPT_N: ! '%N(%m):%03n> '
# # :PROMPT_S: ! '%N(%m):%03n%l ' # # :PROMPT_S: ! '%N(%m):%03n%l '
# # :PROMPT_C: ! '%N(%m):%03n* ' # # :PROMPT_C: ! '%N(%m):%03n* '
# # :RETURN: | # # :RETURN: |
# # => %s # # => %s
# # :CLASSIC: # # :CLASSIC:
# # :PROMPT_I: ! '%N(%m):%03n:%i> ' # # :PROMPT_I: ! '%N(%m):%03n:%i> '
# # :PROMPT_N: ! '%N(%m):%03n:%i> '
# # :PROMPT_S: ! '%N(%m):%03n:%i%l ' # # :PROMPT_S: ! '%N(%m):%03n:%i%l '
# # :PROMPT_C: ! '%N(%m):%03n:%i* ' # # :PROMPT_C: ! '%N(%m):%03n:%i* '
# # :RETURN: | # # :RETURN: |
# # %s # # %s
# # :SIMPLE: # # :SIMPLE:
# # :PROMPT_I: ! '>> ' # # :PROMPT_I: ! '>> '
# # :PROMPT_N: ! '>> '
# # :PROMPT_S: # # :PROMPT_S:
# # :PROMPT_C: ! '?> ' # # :PROMPT_C: ! '?> '
# # :RETURN: | # # :RETURN: |
# # => %s # # => %s
# # :INF_RUBY: # # :INF_RUBY:
# # :PROMPT_I: ! '%N(%m):%03n> ' # # :PROMPT_I: ! '%N(%m):%03n> '
# # :PROMPT_N:
# # :PROMPT_S: # # :PROMPT_S:
# # :PROMPT_C: # # :PROMPT_C:
# # :RETURN: | # # :RETURN: |
@ -243,7 +237,6 @@ require_relative "irb/debug"
# # :AUTO_INDENT: true # # :AUTO_INDENT: true
# # :XMP: # # :XMP:
# # :PROMPT_I: # # :PROMPT_I:
# # :PROMPT_N:
# # :PROMPT_S: # # :PROMPT_S:
# # :PROMPT_C: # # :PROMPT_C:
# # :RETURN: |2 # # :RETURN: |2
@ -528,8 +521,6 @@ module IRB
f = @context.prompt_s f = @context.prompt_s
elsif continue elsif continue
f = @context.prompt_c f = @context.prompt_c
elsif indent > 0
f = @context.prompt_n
else else
f = @context.prompt_i f = @context.prompt_i
end end

View File

@ -229,8 +229,6 @@ module IRB
# #
# See IRB@Customizing+the+IRB+Prompt for more information. # See IRB@Customizing+the+IRB+Prompt for more information.
attr_accessor :prompt_c attr_accessor :prompt_c
# See IRB@Customizing+the+IRB+Prompt for more information.
attr_accessor :prompt_n
# Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the # Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the
# mode set by #prompt_mode= # mode set by #prompt_mode=
# #
@ -414,7 +412,6 @@ module IRB
@prompt_i = pconf[:PROMPT_I] @prompt_i = pconf[:PROMPT_I]
@prompt_s = pconf[:PROMPT_S] @prompt_s = pconf[:PROMPT_S]
@prompt_c = pconf[:PROMPT_C] @prompt_c = pconf[:PROMPT_C]
@prompt_n = pconf[:PROMPT_N]
@return_format = pconf[:RETURN] @return_format = pconf[:RETURN]
@return_format = "%s\n" if @return_format == nil @return_format = "%s\n" if @return_format == nil
if ai = pconf.include?(:AUTO_INDENT) if ai = pconf.include?(:AUTO_INDENT)

View File

@ -58,35 +58,30 @@ module IRB # :nodoc:
@CONF[:PROMPT] = { @CONF[:PROMPT] = {
:NULL => { :NULL => {
:PROMPT_I => nil, :PROMPT_I => nil,
:PROMPT_N => nil,
:PROMPT_S => nil, :PROMPT_S => nil,
:PROMPT_C => nil, :PROMPT_C => nil,
:RETURN => "%s\n" :RETURN => "%s\n"
}, },
:DEFAULT => { :DEFAULT => {
:PROMPT_I => "%N(%m):%03n> ", :PROMPT_I => "%N(%m):%03n> ",
:PROMPT_N => "%N(%m):%03n> ",
:PROMPT_S => "%N(%m):%03n%l ", :PROMPT_S => "%N(%m):%03n%l ",
:PROMPT_C => "%N(%m):%03n* ", :PROMPT_C => "%N(%m):%03n* ",
:RETURN => "=> %s\n" :RETURN => "=> %s\n"
}, },
:CLASSIC => { :CLASSIC => {
:PROMPT_I => "%N(%m):%03n:%i> ", :PROMPT_I => "%N(%m):%03n:%i> ",
:PROMPT_N => "%N(%m):%03n:%i> ",
:PROMPT_S => "%N(%m):%03n:%i%l ", :PROMPT_S => "%N(%m):%03n:%i%l ",
:PROMPT_C => "%N(%m):%03n:%i* ", :PROMPT_C => "%N(%m):%03n:%i* ",
:RETURN => "%s\n" :RETURN => "%s\n"
}, },
:SIMPLE => { :SIMPLE => {
:PROMPT_I => ">> ", :PROMPT_I => ">> ",
:PROMPT_N => ">> ",
:PROMPT_S => "%l> ", :PROMPT_S => "%l> ",
:PROMPT_C => "?> ", :PROMPT_C => "?> ",
:RETURN => "=> %s\n" :RETURN => "=> %s\n"
}, },
:INF_RUBY => { :INF_RUBY => {
:PROMPT_I => "%N(%m):%03n> ", :PROMPT_I => "%N(%m):%03n> ",
:PROMPT_N => nil,
:PROMPT_S => nil, :PROMPT_S => nil,
:PROMPT_C => nil, :PROMPT_C => nil,
:RETURN => "%s\n", :RETURN => "%s\n",
@ -94,7 +89,6 @@ module IRB # :nodoc:
}, },
:XMP => { :XMP => {
:PROMPT_I => nil, :PROMPT_I => nil,
:PROMPT_N => nil,
:PROMPT_S => nil, :PROMPT_S => nil,
:PROMPT_C => nil, :PROMPT_C => nil,
:RETURN => " ==>%s\n" :RETURN => " ==>%s\n"

View File

@ -211,8 +211,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,
@ -241,8 +240,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,
@ -269,8 +267,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,
@ -300,8 +297,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,
@ -331,8 +327,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,
@ -358,8 +353,7 @@ module TestIRB
DEFAULT: { DEFAULT: {
PROMPT_I: '> ', PROMPT_I: '> ',
PROMPT_S: '> ', PROMPT_S: '> ',
PROMPT_C: '> ', PROMPT_C: '> '
PROMPT_N: '> '
} }
}, },
PROMPT_MODE: :DEFAULT, PROMPT_MODE: :DEFAULT,

View File

@ -454,7 +454,6 @@ module TestIRB
def test_default_return_format def test_default_return_format
IRB.conf[:PROMPT][:MY_PROMPT] = { IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ", :PROMPT_I => "%03n> ",
:PROMPT_N => "%03n> ",
:PROMPT_S => "%03n> ", :PROMPT_S => "%03n> ",
:PROMPT_C => "%03n> " :PROMPT_C => "%03n> "
# without :RETURN # without :RETURN

View File

@ -179,7 +179,6 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
write_irbrc <<~'LINES' write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = { IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ", :PROMPT_I => "%03n> ",
:PROMPT_N => "%03n> ",
:PROMPT_S => "%03n> ", :PROMPT_S => "%03n> ",
:PROMPT_C => "%03n> " :PROMPT_C => "%03n> "
} }
@ -214,7 +213,6 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
write_irbrc <<~'LINES' write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = { IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ", :PROMPT_I => "%03n> ",
:PROMPT_N => "%03n> ",
:PROMPT_S => "%03n> ", :PROMPT_S => "%03n> ",
:PROMPT_C => "%03n> " :PROMPT_C => "%03n> "
} }