Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Created November 30, 2014 15:06
Show Gist options
  • Select an option

  • Save jacoyutorius/1d401ce67713f2a3dfee to your computer and use it in GitHub Desktop.

Select an option

Save jacoyutorius/1d401ce67713f2a3dfee to your computer and use it in GitHub Desktop.
Object to YAML script
require "pp"
require "yaml"
list = [
{name: "server105", domain: "server105.frsrv.jp" , ssh: "sample ssh key"},
{name: "server104", domain: "server104.frsrv.jp" , ssh: "sample ssh key"},
{name: "server102", domain: "server102.frsrv.jp" , ssh: "sample ssh key"} ]
data = YAML.load(str)
pp data
File.write "data.txt",list.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment