Hatena::ブログ(Diary)

徒然

2011-06-12

irb関係

| 13:17

1.2.3

  1. gemインストール
  2. .irbrcファイルを作成して
  3. .irbrcファイルを然るべき所に配置

1.

gem install refe

# wirble はコマンドプロンプトだとうまく動作しない。

# バージョンが上がって色付けできるようになるのを期待(現0.1.3)

# gem install wirble

2.

Exploreでは.irbrcというファイルが作成できない。

renコマンドかエディタか何かで保存すれば作成できる。

require 'irb/completion' # tab補完機能

require 'rubygems'

#require 'wirble'

require 'activesupport'

#

#Wirble.init

#Wirble.colorize

module Kernel

def r(arg)

puts `refe #{arg}`

end

private :r

end

class Module

def r(meth = nil)

if meth

if instance_methods(false).include? meth.to_s

puts `refe #{self}##{meth}`

else

super

end

else

puts `refe #{self}`

end

end

end

3.

配置場所は

HOME に %USERPROFILE%を設定する。

指定しなかったら

C:\Documents and Settings\ユーザー名


参考