to-yaml

Ruby to_yaml utf8 string

How can I make ruby to_yaml method to store utf8 strings with original signs but not escape sequence? ...

How to get the formatting options for the to_yaml method working on ruby 1.9.1 ?

According to the YAML documentation it's possible to pass a hash of options to the .to_yaml method. Currently when I pass the options as suggested by the documentation it's not working, the hash is being ignored. irb(main):001:0> require 'yaml' => true irb(main):002:0> user = { "1" => { "name" => "john", "age" => 44 } } user.to_yaml =>...

In ruby-on-rails, how to convert the '\X93' like string format to its original look?

s = "你好" s.encoding # => #<Encoding:UTF-8> yaml = s.to_yaml # => "--- \"\\xE4\\xBD\\xA0\\xE5\\xA5\\xBD\"\n" yaml.encoding # => #<Encoding:ASCII-8BIT> yaml.force_encoding 'utf-8' # => "--- \"\\xE4\\xBD\\xA0\\xE5\\xA5\\xBD\"\n" Then, how to make the 'to_yaml' generate original looking: "你好", I mean not something ...

how to export my ruby on rails application data into a zip file with all attachments and yaml files

im trying to backup my ruby on rails instance as a zip file with yaml files and other attachments in a zip folder. How can i do this? ...