我对 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.
发布评论
评论(1)
RVM与virtualenv类似,也可以查看rbenv(可能更像virtualenv)
Bundler用于打包开发和部署的依赖项,它的工作方式类似于setup.py和pip(我没有使用过pip,似乎具有 rubygems 和 Bundler 的一些功能)
Bundler 的 Gemfile 类似于 pip 的需求文件
Bundler 会在您的开发目录中安装依赖项,并打包部署。
目录布局往往如下所示:
Jeweler 是一个很好的设置工具,维护和释放宝石。
编辑:
这里有一些其他资源:
有关 Ruby 布局的一些链接:
一些针对 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 fileBundler will install dependencies in your development directory, and package them for deployment.
Directory layouts tend to look like this:
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: