Skip to content

Instantly share code, notes, and snippets.

@inkydragon
Created April 24, 2017 11:08
Show Gist options
  • Save inkydragon/0d19872599523a4a579df1d2083781f8 to your computer and use it in GitHub Desktop.
Save inkydragon/0d19872599523a4a579df1d2083781f8 to your computer and use it in GitHub Desktop.
Ruby 命令行工具 irb 的配置文件
## 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