Created
April 24, 2017 11:08
-
-
Save inkydragon/0d19872599523a4a579df1d2083781f8 to your computer and use it in GitHub Desktop.
Ruby 命令行工具 irb 的配置文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is irb' conf | |
# https://inkydragon.github.io/Programming-Ruby-ver-2/#15-Ruby-shell | |
## Autocompletion | |
require 'irb/completion' | |
## Auto-indent | |
IRB.conf[:AUTO_INDENT] = true | |
## Obj check | |
# IRB.conf[:INSPECT_MODE]=false | |
## irb' prompt | |
## = :DEFAULT | :SIMPLE | |
# IRB.conf[:PROMPT_MODE] = :SIMPLE | |
## import/eval outside command | |
## 直接在irb中使用ri | |
def ri(*names) | |
system(%{ri #{names.map {|name| name.to_s}.join(" ")}}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment