summaryrefslogtreecommitdiff
path: root/lib/irb/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/cmd')
-rw-r--r--lib/irb/cmd/info.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/irb/cmd/info.rb b/lib/irb/cmd/info.rb
index ddf57b00b4..53ec71d754 100644
--- a/lib/irb/cmd/info.rb
+++ b/lib/irb/cmd/info.rb
@@ -9,12 +9,11 @@ module IRB
def execute
Class.new {
def inspect
- <<~EOM.chomp
- Ruby version: #{RUBY_VERSION}
- IRB version: #{IRB.version}
- InputMethod: #{IRB.CurrentContext.io.inspect}
- .irbrc path: #{IRB.rc_file}
- EOM
+ 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)
+ str
end
alias_method :to_s, :inspect
}.new