public
Last active

  • Download Gist
gistfile1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# -*- encoding: utf-8 -*-
#
# -
 
require 'psych'
 
ary = ["Jakub Kuźma", "Timo Rößner"]
p ary.first.encoding
 
builder = Psych::Visitors::YAMLTree.new({})
builder << ary
ast = builder.tree
 
io = StringIO.new
 
Psych::Visitors::Emitter.new(io).accept(ast)
 
str = io.string
p str
p str.encoding
 
str.gsub(/ !!null \n/, " \n")

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.