2020-04-27 18:27:19 +09:00
|
|
|
# frozen_string_literal: false
|
|
|
|
|
|
|
|
require_relative "nop"
|
|
|
|
|
|
|
|
# :stopdoc:
|
|
|
|
module IRB
|
|
|
|
module ExtendCommand
|
|
|
|
class Info < Nop
|
|
|
|
def execute
|
|
|
|
Class.new {
|
|
|
|
def inspect
|
2020-04-28 17:06:43 +09:00
|
|
|
str = "Ruby version: #{RUBY_VERSION}\n"
|
|
|
|
str += "IRB version: #{IRB.version}\n"
|
|
|
|
str += "InputMethod: #{IRB.CurrentContext.io.inspect}\n"
|
|
|
|
str += ".irbrc path: #{IRB.rc_file}\n" if File.exist?(IRB.rc_file)
|
2021-02-09 17:29:38 +09:00
|
|
|
str += "RUBY_PLATFORM: #{RUBY_PLATFORM}\n"
|
2021-07-10 22:32:51 +09:00
|
|
|
str += "LANG env: #{ENV["LANG"]}\n" if ENV["LANG"] && !ENV["LANG"].empty?
|
|
|
|
str += "LC_ALL env: #{ENV["LC_ALL"]}\n" if ENV["LC_ALL"] && !ENV["LC_ALL"].empty?
|
2021-07-15 23:42:11 +09:00
|
|
|
if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
|
|
|
codepage = `chcp`.sub(/Active code page: (\d+)\n/, '\1')
|
|
|
|
str += "Code page: #{codepage}\n"
|
|
|
|
end
|
2020-04-28 17:06:43 +09:00
|
|
|
str
|
2020-04-27 18:27:19 +09:00
|
|
|
end
|
|
|
|
alias_method :to_s, :inspect
|
|
|
|
}.new
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
# :startdoc:
|