module ChefConfig::Mixin::DotD
Public Instance Methods
find_dot_d(path)
click to toggle source
Find available configuration files in a ‘.d/` style include directory. Make sure we exclude anything that’s not a file so we avoid directories ending in .rb (just in case)
@api internal @param path [String] Base .d/ path to load from. @return [Array<String>]
# File lib/chef-config/mixin/dot_d.rb, line 28 def find_dot_d(path) Dir["#{PathHelper.escape_glob_dir(path)}/*.rb"].select { |entry| File.file?(entry) }.sort end
load_dot_d(path)
click to toggle source
Load configuration from a ‘.d/` style include directory.
@api internal @param path [String] Base .d/ path to load from. @return [void]
# File lib/chef-config/mixin/dot_d.rb, line 37 def load_dot_d(path) find_dot_d(path).each do |conf| apply_config(IO.read(conf), conf) end end