Sha256: 15af88757ca9bab95ef5b47375075a2aeb434147c96e6ab4101c3e148bd25852
Contents?: true
Size: 325 Bytes
Versions: 10
Compression:
Stored size: 325 Bytes
Contents
require 'murlsh' module Murlsh module_function # Sort a hash by key and write it to a file as YAML. def write_ordered_hash(h, path) h.extend(Murlsh::YamlOrderedHash) h.each_value do |v| v.extend(Murlsh::YamlOrderedHash) if v.is_a?(Hash) end open(path, 'w') { |f| YAML.dump(h, f) } end end
Version data entries
10 entries across 10 versions & 1 rubygems