除了 LICENSE 之外,哪些文件是添加到您的 gem 存储库的好习惯?
我编写了 gem 并将其发布到 github(例如 - https://github.com/randx/six)
我添加了许可证文件。
我经常在其他仓库中看到 VERSION 文件 - 目标是什么?
我还应该添加其他文件吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Greg Brown 所著的《Ruby 最佳实践》第 8 章专门讨论如何正确维护 Ruby 项目,包括目录布局、应包含的文件等。该书可在此处合法在线获取:
http://majesticeacreature.com/rbp-book/pdfs/rbp_1-0.pdf
Chapter 8 of "Ruby Best Practices" by Greg Brown exclusively deals with properly maintaining Ruby projects, including directory layout, files you should include etc. The book is legally available online here:
http://majesticseacreature.com/rbp-book/pdfs/rbp_1-0.pdf
我一直喜欢好的
README
。阅读解释良好的自述文件比浏览自动生成的 RDoc 手册要容易得多。自述文件应该解释 gem 的作用以及如何使用它,并在自述文件的末尾包含示例代码,甚至一些高级示例。另一个重要文件是历史记录或 CHANGES 文件。该文件应包含版本之间主要更改的说明。它不需要包含具体的细节,但应该包含足够的信息,以便从版本 x 升级到版本 y 的人可以快速看到新增内容(以便您可以评估升级的好处)和已更改的内容(以便您可以评估升级对您当前代码的潜在影响)。
我很多次看到缺少 CHANGES 文件的项目,而当您运行升级时,您对发生了什么变化一无所知。
I always love a good
README
. It's much easier to read a well explained README than browse the automatically generated RDoc manual. The README should explain what the gem does and how to use it, with example code and even some advanced examples can be included towards the end of the README.Another essential file is a history or
CHANGES
file. This file should contain an explanation of the major changes between releases. It does not need to include nitty gritty details, but should include enough information so that someone upgrading from version x to version y can quickly see what's new (so you can asses the benefits of upgrading) and what has changed (so you can asses the potential impacts an upgrade has on your current code).Too many times I see projects where the CHANGES file is missing, and you're left pretty much in the dark about what has changed when you run an upgrade.
从我的角度来看,每个 GitHub 项目(根据你的问题,你在那里有一个存储库)应该具有:
.github
文件夹,其中包含问题/拉取请求模板(示例 https://github.com/zold-io/zold/tree/ master/.github).gitingore
以避免意外提交临时/本地文件.gitattributes
用于自定义 Git 存储库配置(更多https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes 和 https://git-scm.com/docs/gitattributes).rubycop.yml< /code>
readme.md
最新版本的状态
显示依赖项的漏洞计数(如果有)
<图片src="https://api.codacy.com/project/badge/Grade/a44d11a620da4ff0a6ff294ff9045aa3" alt="Codacy 徽章">
作为代码质量徽章
上面示例中的项目:
From my perspective each GitHub project (based on your question you have a repo there) should have:
.github
folder with issue/pull requests templates (example https://github.com/zold-io/zold/tree/master/.github).gitingore
to avoid accidentally committed temporal/local files.gitattributes
for custom Git repo configuration (more https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes and https://git-scm.com/docs/gitattributes).rubycop.yml
readme.md
the status of the latest builds
show the vulnurabilities count(if any) for the dependencies
as code quality badges
Projects from the examples above: