[Ruby] Looksee
0.0.1 が公開されたruby-talk:340788。
あるオブジェクトで定義されているメソッドを定義されているクラス、モジュール別に表示するライブラリ。
最初のリリース。
試してみた。
$ sudo gem install looksee
$ cat sample.rb
require 'looksee/shortcuts'
class Foo
def foo
end
end
module Baz
def baz
end
end
class Bar < Foo
include Baz
def bar
end
end
bar = Bar.new
p(lp bar)
def bar.barbar; end
p(lp bar)
$ ruby sample.rb
Bar
bar
Baz
baz
Foo
foo
Object
dump_lookup_path lookup_path
Kernel
!~ hash public_method
=== inspect public_methods
=~ instance_of? public_send
... (中略)
BasicObject
! != == __send__ equal? instance_eval instance_exec
[#<Bar:0x82080c0>]
barbar
Bar
bar
Baz
baz
Foo
foo
Object
dump_lookup_path lookup_path
Kernel
!~ hash public_method
=== inspect public_methods
=~ instance_of? public_send
... (以下略)
動きました。
README.rdocには、~/.irbrc に
require 'looksee/shortcuts'
と書いておいて
$ irb
irb(main):001:0> lp "hello"
みたいな感じで使うように書いてます。
| 固定リンク
この記事へのコメントは終了しました。
コメント