Sha256: 49a523b342bc322ec8a88fcbb05d140c0c5f89351fd30b95ebe14ab591d39fdd
Contents?: true
Size: 1000 Bytes
Versions: 1
Compression:
Stored size: 1000 Bytes
Contents
# -*- encoding: utf-8 -*- require 'yaml' # YAML extensions module YAML # Specify one or more directory patterns and pass each YAML file in the matching directories to a block. # # @see [Dir#glob](http://www.ruby-doc.org/core/classes/Dir.html#M002347) for pattern details. # # @example To load documents in files ending in ".yaml" # YAML.load_dir('/tmp/*.yaml'){|yaml_document| # #...whatever you want to do with each yaml document # } # # @example To load documents in files beginning in "foo" or "bar" # YAML.load_dir('/tmp/foo*.yaml','/tmp/bar*.yaml','){|yaml_document| # #...whatever you want to do with the yaml document # } 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 #def end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
webget_ruby_ramp-1.8.2 | lib/webget_ruby_ramp/yaml.rb |