显示源代码URL的RubyGems不起作用

发布于 2025-02-13 21:15:46 字数 785 浏览 0 评论 0原文

我在RubyGem上有多个宝石,其中一些显示了源代码链接,有些则没有。

我的印象是,您要设置源代码链接所需要做的就是设置source_code_uri .gemspec中的元数据

是否还有其他需要配置的设置?

# This one Works
spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/handlebars-helpers'

# This one does NOT work
spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/cmdlet'

“ nofollow noreferrer”> handlebars-helpers gemspec gemspec

href =“ https://github.com/klueless-io/cmdlet/blob/main/cmdlet.gemspec” rel =“ nofollow noreferrer”> cmdlet gemspec

I have multiple GEMs on RubyGems and some of them show the Source Code link and some do not.

I am under the impression that all you need to do to set the source code link is set the source_code_uri meta data in the .gemspec

Is there another setting that needs to be configured?

# This one Works
spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/handlebars-helpers'

# This one does NOT work
spec.metadata['source_code_uri'] = 'https://github.com/klueless-io/cmdlet'

Handlebars-Helpers GemSpec

Cmdlet GemSpec

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

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

发布评论

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

评论(1

眼前雾蒙蒙 2025-02-20 21:15:47

cmdlet.gemspec 是缺少rubygem信息的宝石,然后有这些行:

spec.metadata['homepage_uri']     = spec.homepage
spec.metadata['source_code_uri']  = 'https://github.com/klueless-io/cmdlet'
spec.metadata['changelog_uri']    = 'https://github.com/klueless-io/cmdlet/blob/main/CHANGELOG.md'

然后在同一文件中下面:

spec.metadata = {
  'rubygems_mfa_required' => 'true'
}

这意味着如何方式您设置RubyGems_Mfa_required重置整个spec.metadata hash。

只需将ruby​​gems_mfa_required分配更改为以下内容,它将在下一个GEM推向RubyGems之后起作用:

spec.metadata['rubygems_mfa_required'] = 'true'

When looking into the cmdlet.gemspec which is the gem that is missing information on Rubygems, then there are these lines:

spec.metadata['homepage_uri']     = spec.homepage
spec.metadata['source_code_uri']  = 'https://github.com/klueless-io/cmdlet'
spec.metadata['changelog_uri']    = 'https://github.com/klueless-io/cmdlet/blob/main/CHANGELOG.md'

and then below in the same file:

spec.metadata = {
  'rubygems_mfa_required' => 'true'
}

That means the way how you set rubygems_mfa_required resets the whole spec.metadata hash.

Just change the rubygems_mfa_required assignment to the following and it will work after the next gem push to Rubygems:

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