Ruby 打包生态系统作为 Python 术语

发布于 2024-12-12 05:38:36 字数 391 浏览 7 评论 0 原文

我对 Ruby 有一些经验,但比我的 Python 经验要少。我已经打包并发布了多个 Python 包,但我只发布了一个 Ruby 包。我想通过与 Python 的比较来快速了解 Ruby 打包生态系统。

  • 我相信 Ruby 中有相当于 virtualenv 的工具,但我还不知道那是什么。 RVM和Bundler的作用是什么?
  • 当我编写 Python 包时,我通常使用 setup.pydevelop 命令 - 它会解析依赖项,但不会安装到站点包中。 Ruby 中等效的东西是什么?
  • 制作 Ruby 包的目录布局结构的首选方法是什么?
  • Gem 包命名规则。 Gem 名称区分大小写吗?它应该与包含的 Ruby 模块的名称相同吗?
  • 我错过的任何其他要点。

I have some experience with Ruby, but it’s less than my Python experience. I've packaged and published several Python packages, but there’s only one Ruby package I've published. I want to learn rapidly about Ruby packaging ecosystem by comparing to Python.

  • I believe that there’s the tool equivalent to virtualenv in Ruby, but I don’t know what is that yet. What are the roles of RVM and Bundler?
  • When I write a Python package, I usually use setup.py develop command — it resolves the dependencies but is not installed to site-packages. What is the equivalent thing in Ruby?
  • What is the preferred way to make a directory layout structure of Ruby packages?
  • Gem package naming rule. Is Gem name case sensitive? Should it be the same as the contained Ruby module's name?
  • Any other points I missed.

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

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

发布评论

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

评论(1

请远离我 2024-12-19 05:38:36

RVM与virtualenv类似,也可以查看rbenv(可能更像virtualenv)

Bundler用于打包开发和部署的依赖项,它的工作方式类似于setup.py和pip(我没有使用过pip,似乎具有 ruby​​gems 和 Bundler 的一些功能)

Bundler 的 Gemfile 类似于 pip 的需求文件

Bundler 会在您的开发目录中安装依赖项,并打包部署。

目录布局往往如下所示:

/ -
  lib - classes / modules etc.
  bin - executables things you want on $PATH
  test - unit tests

Jeweler 是一个很好的设置工具,维护和释放宝石。

编辑:

这里有一些其他资源:

有关 Ruby 布局的一些链接:

一些针对 Python 的:

  • < a href="https://stackoverflow.com/questions/193161/what-is-the-best-project-struct-for-a-python-application">Python 应用程序的最佳项目结构是什么?
  • 在 python 中初始化项目布局?

下面是对工具的比较:

RVM is similar to virtualenv also checkout rbenv (perhaps more like virtualenv)

Bundler is for packaging dependencies for development and deployment, it works like setup.py and pip (I haven't used pip, it seems to have some features of rubygems and Bundler)

Bundler's Gemfile is similar to pip's requirement file

Bundler will install dependencies in your development directory, and package them for deployment.

Directory layouts tend to look like this:

/ -
  lib - classes / modules etc.
  bin - executables things you want on $PATH
  test - unit tests

Jeweler is a good tool for setting up, maintaining and releasing gems.

EDIT:

Here are some other resources:

Some links on Ruby layout:

Some for Python:

Here's one making a comparison of tools:

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