Sha256: cd9264e8b0ee6302622d41fe3e7fd2a4b5f62f47b1b7282f7755a55ba5fec488

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 Bytes

Contents

module SengiriYaml
  require "yaml"
  require "pathname"

  class Loader
    # load divided yaml files
    # @param src_dir [String] divided yaml dir
    # @return [Hash] merged yaml hash
    def load_dir(src_dir)
      merged_content = ""

      Pathname.glob("#{src_dir}/*.yml") do |yaml_path|
        content = yaml_path.read.gsub(/^---$/, "")
        merged_content << content
      end

      YAML.load(merged_content)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sengiri_yaml-0.0.2 lib/sengiri_yaml/loader.rb