how to list up active gem names
1 >> $:.grep(%r{/gems/([^/]+-[0-9\.]+)/lib$}){$1} 2 => ["addressable-2.0.2", "merb-auth- slice-pass word-1.0.8 .1", "json-1.1.4 .1", "extlib-0.9 .10", ...
1 >> $:.grep(%r{/gems/([^/]+-[0-9\.]+)/lib$}){$1} 2 => ["addressable-2.0.2", "merb-auth- slice-pass word-1.0.8 .1", "json-1.1.4 .1", "extlib-0.9 .10", ...
methopara
is a gem that enables us to use Method#parameters
And this time, I added an interface to use it for UnboundMet
1 require 'rubygems' 2 require 'methopara' 3 4 class Foo 5 def foo(a,b) end 6 end 7 Foo.instance_method(:foo).parameters 8 #=> [[:req, :a], [:req, :b]]
Enjoy!
Yesterday (Feb 10, 2009),
asakusa.rb
In the monthly meet-up of that community,
@ko1_twitte
And I made it as a gem for ease of use. Now we can use it by the command below.
1 % sudo gem install methopara --source http://merbi.st
Usage is as follows.
1 >> require "rubygems" 2 >> require "methopara" 3 >> def foo(a,b=nil,&c) end 4 >> method(:foo).parameters5 => [[:req, :a], [:opt, :b], [:block, :c]]
This gem is only for Ruby-1.9.1
Enjoy!
See Also