Sha256: 02046a242c296e1748ca890103e6e9a91ef652e8e3f33deae883c16f37221bc8

Contents?: true

Size: 331 Bytes

Versions: 1

Compression:

Stored size: 331 Bytes

Contents

module Envault
  class Formatter
    def self.escape_yaml(hash, quote = true)
      lines = []
      hash.map do |k, v|
        lines << %Q{#{k}: #{quote ? v.inspect : v}}
      end
      lines.join("\n")
    end

    def self.write_escape_yaml(path, hash, quote = true)
      File.write(path, escape_yaml(hash))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
envault-0.2.1 lib/envault/formatter.rb