~/.irbrc

Tags:

irb들어가서 usage 치시면 도움말이 나옵니다.
그리고 ri는 system 에서 ri 실행합니다.

Programming Ruby 2nd 보고 제 입맛대로 만들었습니다. ㅎㅎ

IRB.conf[:IRB_RC] = proc do |conf|
        conf.prompt_mode = :SIMPLE
        conf.prompt_i = '>> '
        conf.prompt_c = '-> '
        conf.prompt_s = '-> '

end

require "irb/completion"
require "irb/xmp"

def ri(*names)
        system(%{ri #{names.map {|name| name.to_s}.join(" ")}})
end

def usage
        puts "* Command listing"
        puts "irb [Obj]   : Start a new irb session, optionally in the context of obj"
        puts "jobs        : Show irb session listing"
        puts "kill <n>    : Kill session n"
        puts "fg <n>      : Switch to session n"
        puts "cb <obj>    : Change current binding to given obj"
        puts "ri <...>    : Get RDoc"
        puts "TAB key     : auto completion"
        puts "xmp %{ ... }: Neatly evaluate given expressions"
end

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *