[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."
|
||||
|
||||
def execute
|
||||
Class.new {
|
||||
def inspect
|
||||
str = "Ruby version: #{RUBY_VERSION}\n"
|
||||
str += "IRB version: #{IRB.version}\n"
|
||||
str += "InputMethod: #{IRB.CurrentContext.io.inspect}\n"
|
||||
@ -25,10 +23,8 @@ module IRB
|
||||
codepage = `chcp`.b.sub(/.*: (\d+)\n/, '\1')
|
||||
str += "Code page: #{codepage}\n"
|
||||
end
|
||||
str
|
||||
end
|
||||
alias_method :to_s, :inspect
|
||||
}.new
|
||||
puts str
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user