简体   繁体   English

撬显示源未显示实现

[英]Pry show-source not showing implementation

Using Pry show-source it's not showing me the method implementation as I expected: 使用Pry show-source并没有像我期望的那样向我展示方法的实现:

[2] pry(main)> show-source Object#extend

From: eval.c (C Method):
Owner: Kernel
Visibility: public
Number of lines: 3

static VALUE
rb_obj_extend(argc, argv, obj)
int argc;

That's all I get, but according to the official docs (I have pry-doc installed) I should see: 这就是我得到的,但是根据官方文档 (我已经安装了pry-doc),我应该看到:

[1] pry(main)> show-source Object#extend

From: eval.c (C Method):
Owner: Kernel
Visibility: public
Number of lines: 16

static VALUE
rb_obj_extend(int argc, VALUE *argv, VALUE obj)
{
    int i;

    if (argc == 0) {
         rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
    }
    for (i = 0; i < argc; i++)
    Check_Type(argv[i], T_MODULE);
    while (argc--) {
        rb_funcall(argv[argc], rb_intern("extend_object"), 1, obj);
        rb_funcall(argv[argc], rb_intern("extended"), 1, obj);
    }
    return obj;
}
[2] pry(main)>

Any ideas about why is this happening? 关于为什么会发生任何想法?

This solved it for me: 这为我解决了:

$ rvm docs generate all

Also useful, if you want to generate the ri docs for all your installed gems: 如果要为所有已安装的gem生成ri文档,它也很有用:

gem rdoc --all --ri --no-rdoc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM