除了 LICENSE 之外,哪些文件是添加到您的 gem 存储库的好习惯?

发布于 2024-11-30 02:18:49 字数 202 浏览 3 评论 0 原文

我编写了 gem 并将其发布到 github(例如 - https://github.com/randx/six

我添加了许可证文件。

我经常在其他仓库中看到 VERSION 文件 - 目标是什么?

我还应该添加其他文件吗?

I wrote gem and published it to github (ex - https://github.com/randx/six)

I added LICENSE file.

I often see VERSION file in other repo - whats the goal?

Any other files should I add?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

赢得她心 2024-12-07 02:18:49

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

放我走吧 2024-12-07 02:18:49

我一直喜欢好的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.

走走停停 2024-12-07 02:18:49

从我的角度来看,每个 GitHub 项目(根据你的问题,你在那里有一个存储库)应该具有:

  1. 与 CI 服务器(Travis CI、Circle CI 等)集成
  2. .github 文件夹,其中包含问题/拉取请求模板(示例 https://github.com/zold-io/zold/tree/ master/.github
  3. .gitingore 以避免意外提交临时/本地文件
  4. .gitattributes 用于自定义 Git 存储库配置(更多https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributeshttps://git-scm.com/docs/gitattributes)
  5. .rubycop.yml< /code>
  6. 将以下徽章添加到您的 readme.md

上面示例中的项目:

From my perspective each GitHub project (based on your question you have a repo there) should have:

  1. Integration with CI servers (Travis CI, Circle CI, etc)
  2. .github folder with issue/pull requests templates (example https://github.com/zold-io/zold/tree/master/.github)
  3. .gitingore to avoid accidentally committed temporal/local files
  4. .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)
  5. .rubycop.yml
  6. Add the following badges to your readme.md
  • Gem Version version of your ruby gem
  • License: MIT license details
  • Commit activity commit activity per year to hightlight the status of the project
  • Hits-of-Code More about HoC here https://www.yegor256.com/2014/11/14/hits-of-code.html
  • Build Status
    Build Status the status of the latest builds
  • Dependency Status the status of dependencies (obsolte or not)
  • Known Vulnerabilities
    show the vulnurabilities count(if any) for the dependencies
  • Maintainability Rating
    Codebeat
    Codacy Badge
    SQ coverage
    Codecov
    Code Climate as code quality badges

Projects from the examples above:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文