Does requiring a gem load everything, including things I don't use?

不打扰是莪最后的温柔 提交于 2019-12-06 09:52:34
knut

You include scripts or files, not gems.

With

require 'x' 

you load the file x.rb. Which x.rb you load is defined by the search path, the search pathes can be modified by gem definitions (what you didn't use in your example code).

Everything inside the file x.rb is loaded. If x.rb contains other require commands, those files are also loaded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!