class Envault::Formatter

Public Class Methods

escape_yaml(hash, quote = true) click to toggle source
# File lib/envault/formatter.rb, line 3
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
write_escape_yaml(path, hash, quote = true) click to toggle source
# File lib/envault/formatter.rb, line 11
def self.write_escape_yaml(path, hash, quote = true)
  File.write(path, escape_yaml(hash, quote))
end