Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ri或fastri for ruby查找类/方法的源文件_Ruby - Fatal编程技术网

使用ri或fastri for ruby查找类/方法的源文件

使用ri或fastri for ruby查找类/方法的源文件,ruby,Ruby,比如说,我喜欢 $fri group_by ---------------------------------------------------- Enumerable#group_by enum.group_by {| obj | block } => a_hash ------------------------------------------------------------------------ Returns a hash, which keys

比如说,我喜欢

$fri group_by
---------------------------------------------------- Enumerable#group_by
     enum.group_by {| obj | block }  => a_hash
------------------------------------------------------------------------
     Returns a hash, which keys are evaluated result from the block, 
     and values are arrays of elements in enum corresponding to the key.

        (1..6).group_by {|i| i%3}   #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
不过我很确定groupby不是标准ruby库的一部分。
如何找出哪个库是monkey patching可枚举库

group\u by
是自1.8.7起的一部分。

将ri\u用于gem:

>> require 'ri_for' >> Enumerable.ri_for :group_by sig: Enumerable#group_by arity 0 appears to be a c method Original code signature: sig: Enumerable#group_by arity 0 #parameters signature: group_by( [] ) Searching ri for sig: Enumerable#group_by arity 0 ... Nothing known about Enumerable (end ri) => "#" >>需要“ri_for” >>Enumerable.ri_用于:分组依据 sig:可枚举的#组_按算术0 似乎是一个c方法 原始代码签名:sig:Enumerable#group_by arity 0 #参数签名:分组人([]) 寻找 sig:可枚举的#组_按算术0 ... 不知道什么是可枚举的 (完) => "#"
(事实上,它是一个c方法,这意味着它可能在内核中)

目前无法为安装ri_<代码>错误:执行gem时。。。(Gem::DependencyError)无法解析依赖项:ruby2ruby需要sexp_处理器(~>4.0);ParseTree需要sexp_处理器(~>3.2.0);ruby_解析器需要sexp_处理器(~>4.1)