分析可能未被调用/已死的方法,现在还提供自动删除功能。
= debride 首页 :: https://github.com/seattlerb/debride rdoc :: http://docs.seattlerb.org/debride == 说明: 分析可能未被调用/已死的方法,现在还提供自动删除功能。 == 特性/问题:
debride_rails_whitelist 从日志中生成一个经验性的白名单。 * 使用 path_expander,因此可以使用: * dir_arg - 自动扩展目录 * @file_of_args - 将参数保存到文件中 * -path_to_subtract - 忽略交叉的文件/目录子集MyClass good_method lib/some/file.rb:16 bad_method lib/some/file.rb:20 … 但你知道 good_method 被调用了(可能是因为它是公共的) API),然后您可以将其添加到白名单中: % echo good_method > whitelist.txt % debride --whitelist whitelist.txt lib 这些方法可能不会被调用: MyClass bad_method lib/some/file.rb:20 …
以下是一个典型 Rails 应用程序的使用示例: # 将 rake 路由路径存储到文件中 % rake routes > routes.txt # 根据生产日志中的路由和使用情况生成白名单 % debride_rails_whitelist routes.txt log/production.log | sort -u > whitelist.txt # 添加迁移方法 % echo up >> whitelist.txt % echo down >> whitelist.txt % echo change >> whitelist.txt # 使用以下选项输出 debride 报告: # 忽略典型的 Rails 方法 # 指定生成的白名单 # 在当前目录 (".") 运行 % debride --rails --whitelist whitelist.txt
要生成包含过去 28 天的日志的白名单,请运行以下命令: % seq 2 29 | xargs -I {} date -u -v-{}d +%Y-%m-%d | xargs -I {} curl --progress-bar -f --no-include -L -H "X-Papertrail-To
暂无开放 Issues,或尚未同步最近议题。