Skip to content

Commit 0613589

Browse files
authored
Make $ and @ default aliases (#438)
1 parent 7369dab commit 0613589

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/irb/init.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ def IRB.init_config(ap_path)
159159

160160
@CONF[:AT_EXIT] = []
161161

162-
@CONF[:COMMAND_ALIASES] = {}
162+
@CONF[:COMMAND_ALIASES] = {
163+
:'$' => :show_source,
164+
:'@' => :whereami,
165+
}
163166
end
164167

165168
def IRB.set_measure_callback(type = nil, arg = nil, &block)

test/irb/test_cmd.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ def test_whereami
551551
def test_whereami_alias
552552
out, err = execute_lines(
553553
"@\n",
554-
conf: { COMMAND_ALIASES: { :'@' => :whereami } }
555554
)
556555
assert_empty err
557556
assert_match(/^From: .+ @ line \d+ :\n/, out)
@@ -563,7 +562,6 @@ def test_vars_with_aliases
563562
out, err = execute_lines(
564563
"@foo\n",
565564
"$bar\n",
566-
conf: { COMMAND_ALIASES: { :'$' => :show_source, :'@' => :whereami } }
567565
)
568566
assert_empty err
569567
assert_match(/"foo"/, out)

0 commit comments

Comments
 (0)