@@ -11,24 +11,20 @@ class IrbInfo < Nop
11
11
description "Show information about IRB."
12
12
13
13
def execute
14
- Class . new {
15
- def inspect
16
- str = "Ruby version: #{ RUBY_VERSION } \n "
17
- str += "IRB version: #{ IRB . version } \n "
18
- str += "InputMethod: #{ IRB . CurrentContext . io . inspect } \n "
19
- str += ".irbrc path: #{ IRB . rc_file } \n " if File . exist? ( IRB . rc_file )
20
- str += "RUBY_PLATFORM: #{ RUBY_PLATFORM } \n "
21
- str += "LANG env: #{ ENV [ "LANG" ] } \n " if ENV [ "LANG" ] && !ENV [ "LANG" ] . empty?
22
- str += "LC_ALL env: #{ ENV [ "LC_ALL" ] } \n " if ENV [ "LC_ALL" ] && !ENV [ "LC_ALL" ] . empty?
23
- str += "East Asian Ambiguous Width: #{ Reline . ambiguous_width . inspect } \n "
24
- if RbConfig ::CONFIG [ 'host_os' ] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
25
- codepage = `chcp` . b . sub ( /.*: (\d +)\n / , '\1' )
26
- str += "Code page: #{ codepage } \n "
27
- end
28
- str
29
- end
30
- alias_method :to_s , :inspect
31
- } . new
14
+ str = "Ruby version: #{ RUBY_VERSION } \n "
15
+ str += "IRB version: #{ IRB . version } \n "
16
+ str += "InputMethod: #{ IRB . CurrentContext . io . inspect } \n "
17
+ str += ".irbrc path: #{ IRB . rc_file } \n " if File . exist? ( IRB . rc_file )
18
+ str += "RUBY_PLATFORM: #{ RUBY_PLATFORM } \n "
19
+ str += "LANG env: #{ ENV [ "LANG" ] } \n " if ENV [ "LANG" ] && !ENV [ "LANG" ] . empty?
20
+ str += "LC_ALL env: #{ ENV [ "LC_ALL" ] } \n " if ENV [ "LC_ALL" ] && !ENV [ "LC_ALL" ] . empty?
21
+ str += "East Asian Ambiguous Width: #{ Reline . ambiguous_width . inspect } \n "
22
+ if RbConfig ::CONFIG [ 'host_os' ] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
23
+ codepage = `chcp` . b . sub ( /.*: (\d +)\n / , '\1' )
24
+ str += "Code page: #{ codepage } \n "
25
+ end
26
+ puts str
27
+ nil
32
28
end
33
29
end
34
30
end
0 commit comments