[ruby/irb] Make $ and @ default aliases
(https://github.com/ruby/irb/pull/438) https://github.com/ruby/irb/commit/0613589476
This commit is contained in:
parent
bab8051d2d
commit
0de3bc92b4
@ -159,7 +159,10 @@ module IRB # :nodoc:
|
||||
|
||||
@CONF[:AT_EXIT] = []
|
||||
|
||||
@CONF[:COMMAND_ALIASES] = {}
|
||||
@CONF[:COMMAND_ALIASES] = {
|
||||
:'$' => :show_source,
|
||||
:'@' => :whereami,
|
||||
}
|
||||
end
|
||||
|
||||
def IRB.set_measure_callback(type = nil, arg = nil, &block)
|
||||
|
@ -551,7 +551,6 @@ module TestIRB
|
||||
def test_whereami_alias
|
||||
out, err = execute_lines(
|
||||
"@\n",
|
||||
conf: { COMMAND_ALIASES: { :'@' => :whereami } }
|
||||
)
|
||||
assert_empty err
|
||||
assert_match(/^From: .+ @ line \d+ :\n/, out)
|
||||
@ -563,7 +562,6 @@ module TestIRB
|
||||
out, err = execute_lines(
|
||||
"@foo\n",
|
||||
"$bar\n",
|
||||
conf: { COMMAND_ALIASES: { :'$' => :show_source, :'@' => :whereami } }
|
||||
)
|
||||
assert_empty err
|
||||
assert_match(/"foo"/, out)
|
||||
|
Loading…
x
Reference in New Issue
Block a user