百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

annotate_gem

> 编程语言
开源

:evergreen_tree: 为每个依赖项添加 Gemfile 中的注释

174 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

:evergreen_tree: 为每个依赖项添加 Gemfile 中的注释

AnnotateGem

annotate-gem is command line tool that will add useful comments to your Gemfile. For each gem, annotate-gem will create a comment with the gem's description and the gem's website. For example, a Gemfile containing the following

ruby
gem "rails"
gem "nokogiri"
gem "brakeman"

will be converted into something that is more descriptive and is self-documenting:

ruby
# Full-stack web application framework. (http://www.rubyonrails.org)
gem "rails"
# Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
gem "nokogiri"
# Security vulnerability scanner for Ruby on Rails. (http://brakemanscanner.org)
gem "brakeman"

The motivation for annotate-gem is that developers often open a Gemfile and not know what many of the listed gems are actually for. It's hard to track down which gem is providing which functionality. This is a common problem since many gem names do not reflect the actual feature.

If you do not want to install the gem, you can also visit which is a web interface for annotate-gem.

Installation

$ gem install annotate_gem

Usage

Running annotate-gem itself will add comments to the current directory's Gemfile.

$ cat Gemfile
source 'https://rubygems.org'
gem "pry"
$ annotate-gem
$ cat Gemfile
source 'https://rubygems.org'
# An IRB alternative and runtime developer console (http://pryrepl.org)
gem "pry"

annotate-gem has several options:

$ annotate_gem --help
  Add comments to your Gemfile with each dependency's description.
        Usage: annotate_gem [options]
               annotate_gem [gem name]
        --website-only               Only output the website
        --description-only           Only output the description
        --new-comments-only          Only add a comment to gemfile if there isn't a comment already (for non-inline comments)
        --inline                     Inline the comment
    -h, --help                       Show this message
    -v, --version                    Show version

annotate-gem also works with specifying a single gem name:

$ annotate-gem aasm
State machine mixin for Ruby objects (https://github.com/aasm/aasm)

Contributing

  1. Fork it ( https://github.com/ivantsepp/annotate_gem/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Issues· 2 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言