[ruby/irb] Simplify irb_info command
(https://github.com/ruby/irb/pull/597) https://github.com/ruby/irb/commit/0a0409c52b
This commit is contained in:
parent
76ee4edb97
commit
273b38475e
@ -11,8 +11,6 @@ module IRB
|
|||||||
description "Show information about IRB."
|
description "Show information about IRB."
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
Class.new {
|
|
||||||
def inspect
|
|
||||||
str = "Ruby version: #{RUBY_VERSION}\n"
|
str = "Ruby version: #{RUBY_VERSION}\n"
|
||||||
str += "IRB version: #{IRB.version}\n"
|
str += "IRB version: #{IRB.version}\n"
|
||||||
str += "InputMethod: #{IRB.CurrentContext.io.inspect}\n"
|
str += "InputMethod: #{IRB.CurrentContext.io.inspect}\n"
|
||||||
@ -25,10 +23,8 @@ module IRB
|
|||||||
codepage = `chcp`.b.sub(/.*: (\d+)\n/, '\1')
|
codepage = `chcp`.b.sub(/.*: (\d+)\n/, '\1')
|
||||||
str += "Code page: #{codepage}\n"
|
str += "Code page: #{codepage}\n"
|
||||||
end
|
end
|
||||||
str
|
puts str
|
||||||
end
|
nil
|
||||||
alias_method :to_s, :inspect
|
|
||||||
}.new
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user