2017-04-08 86 views
7
  1. 是什么bundle & bundler命令之间的区别?束VS捆扎机/捆束VS安装

  2. bundle & bundle install?有什么区别?

  3. 如果没有区别,为什么有多个命令做同样的事情?

回答

6
  1. 的可执行bundle & bundler have the same functionality,因此可以互换使用。您可以在bundler/exe目录中看到bundler可执行文件只是加载bundle可执行文件。在我看来,bundle命令比bundler命令更常用。

  2. 命令bundle & bundle install也具有相同的功能。 bundle使用Thorbundle's default task is install。另外,因为bundle's task i is mapped (aliased) to install,所以bundle ibundle install做同样的事情。

  3. 这是一个很棒的问题。 :-) Ruby倾向于遵循Perl programming motto: "There's more than one way to do it."我倾向于倾向于Zen of Python原则:“应该有一个 - 最好只有一个 - 明显的方式来做到这一点。”我认为后者的原则迎合了principle of least astonishment,并倾向于帮助keep things simple。总的来说,我仍倾向于使用Ruby进行编程(特别是在构建基于HTTP的RESTful API时,我使用Rack)。我认为Ruby是简单,优雅和可读的。如果采用Python对这个问题的立场,Ruby可能会更好。