Module: YAML
- Defined in:
- lib/webget_ruby_ramp/yaml.rb
Overview
YAML extensions
Class Method Summary collapse
-
.load_dir(*dirpaths) ⇒ Object
Specify one or more directory patterns and pass each YAML file in the matching directories to a block.
Class Method Details
.load_dir(*dirpaths) ⇒ Object
Specify one or more directory patterns and pass each YAML file in the matching directories to a block.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/webget_ruby_ramp/yaml.rb', line 24 def YAML.load_dir(*dirpaths) dirpaths=[*dirpaths.flatten] dirpaths.each do |dirpath| Dir[dirpath].each do |filename| File.open(filename) do |file| YAML.load_documents(file) do |doc| yield doc end #load end #file end #dir end #each end |