Skip to content

Commit 39d1cd8

Browse files
committed
The command "irb_info" should show RUBY_PLATFORM
1 parent 942448c commit 39d1cd8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/irb/cmd/info.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def inspect
1313
str += "IRB version: #{IRB.version}\n"
1414
str += "InputMethod: #{IRB.CurrentContext.io.inspect}\n"
1515
str += ".irbrc path: #{IRB.rc_file}\n" if File.exist?(IRB.rc_file)
16+
str += "RUBY_PLATFORM: #{RUBY_PLATFORM}\n"
1617
str
1718
end
1819
alias_method :to_s, :inspect

test/irb/test_cmd.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def test_irb_info_multiline
4848
Ruby\sversion: .+\n
4949
IRB\sversion:\sirb .+\n
5050
InputMethod:\sReidlineInputMethod\swith\sReline .+ and .+\n
51-
\.irbrc\spath: .+
51+
\.irbrc\spath: .+\n
52+
RUBY_PLATFORM: .+
5253
}x
5354
assert_match expected, irb.context.main.irb_info.to_s
5455
end
@@ -67,7 +68,8 @@ def test_irb_info_singleline
6768
Ruby\sversion: .+\n
6869
IRB\sversion:\sirb .+\n
6970
InputMethod:\sReadlineInputMethod\swith .+ and .+\n
70-
\.irbrc\spath: .+
71+
\.irbrc\spath: .+\n
72+
RUBY_PLATFORM: .+
7173
}x
7274
assert_match expected, irb.context.main.irb_info.to_s
7375
end
@@ -89,6 +91,7 @@ def test_irb_info_multiline_without_rc_files
8991
Ruby\sversion: .+\n
9092
IRB\sversion:\sirb .+\n
9193
InputMethod:\sReidlineInputMethod\swith\sReline\s[^ ]+(?!\sand\s.+)\n
94+
RUBY_PLATFORM: .+\n
9295
\z
9396
}x
9497
assert_match expected, irb.context.main.irb_info.to_s
@@ -115,6 +118,7 @@ def test_irb_info_singleline_without_rc_files
115118
Ruby\sversion: .+\n
116119
IRB\sversion:\sirb .+\n
117120
InputMethod:\sReadlineInputMethod\swith\s(?~.*\sand\s.+)\n
121+
RUBY_PLATFORM: .+\n
118122
\z
119123
}x
120124
assert_match expected, irb.context.main.irb_info.to_s

0 commit comments

Comments
 (0)