Module: Chef::Sugar::Kernel
- Defined in:
- lib/chef/sugar/kernel.rb
Defined Under Namespace
Classes: ChefGemLoadError
Instance Method Summary collapse
-
#require_chef_gem(name) ⇒ Boolean
Require a gem that should have been installed by Chef, such as in a recipes as a
chef_gem
.
Instance Method Details
#require_chef_gem(name) ⇒ Boolean
Require a gem that should have been installed by Chef, such as in a recipes as a chef_gem
. This method will gracefully degrade if the gem cannot be loaded.
42 43 44 45 46 |
# File 'lib/chef/sugar/kernel.rb', line 42 def require_chef_gem(name) require(name) rescue LoadError raise ChefGemLoadError.new(name) end |