gpt4 book ai didi

# TODO in rails(#轨道中的TODO)

转载 作者:bug小助手 更新时间:2023-10-22 16:38:53 26 4
gpt4 key购买 nike



I had read through a rails book and once found we can add # TODO: and some # stuff in codes, so we can you some rake cmd to look back.

我读了一本rails的书,有一次发现我们可以在代码中添加#TODO:和一些#东西,所以我们可以给你一些rake cmd来回顾。


My problems is I can't find where are those "# stuff" and "rake cmd" I google and search around, but can't find and don't know what keywords to search.

我的问题是,我找不到那些“#东西”和“rake cmd”在哪里,我在谷歌上搜索,但找不到,也不知道该搜索什么关键词。


更多回答
优秀答案推荐

You can use # TODO, # FIXME, and # OPTIMIZE and you can easily get all of these with the following rake task: rake notes

您可以使用#TODO、#FIXME和#OPTIMIZE,并且可以通过以下rake任务轻松获得所有这些:rake notes



In addition to the default annotations, you can always specify and search for your own annotations:

除了默认注释外,您还可以指定并搜索自己的注释:



rake notes:custom ANNOTATION=ZOMG


rake notes:todo

rake注释:todo



btw, you need to run that command from the root dir of your rails app. Also, you can run:

顺便说一句,您需要从rails应用程序的根目录运行该命令。此外,您还可以运行:



rake -T


to get a full list of the tasks in your rails' Rakefile

获取rails的Rakefile中任务的完整列表



grep -rn "# TODO" .


Print all annotations

打印所有批注


$ bin/rails notes

app/models/user.rb:
* [ 110] [TODO] Refactor this

test/test_helper.rb:
* [ 72] [FIXME] Unable to stub this method in the `sign_in` helper

Print specific annotations (FIXME)

打印特定注释(FIXME)


$ bin/rails notes -a FIXME

test/test_helper.rb:
* [ 72] Unable to stub this method in the `sign_in` helper

更多回答

Will look through every file in project, which may be slow and not useful.

将查看项目中的每个文件,这可能很慢,也没有用处。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com