运行 capify 后,默认的 Capfile 始终以以下内容开头:
load 'deploy'
当我>puts $"时,我在加载路径上没有看到deploy.rb文件,但我假设这会加载capistrano附带的默认部署配方?
最佳答案
来自Ruby Standard library documentation for Kernel.load
:
load(filename, wrap=false) → true
Loads and executes the Ruby program in the file filename. If the filename does not resolve to an absolute path, the file is searched for in the library directories listed in $:. If the optional wrap parameter is true, the loaded script will be executed under an anonymous module, protecting the calling program’s global namespace. In no circumstance will any local variables in the loaded file be propagated to the loading environment.
load 'deploy'
的作用完全符合您的想象,它从 Capistrano 中加载 deploy.rb
。
关于ruby-on-rails - 卡皮斯特拉诺卡文件 : what does >load 'deploy' do?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19552699/