Writing ...

wideip_file = nil
wideip_file_name = "#{device_name}-wideips.txt"
File.delete(wideip_file_name) if File.exist?(wideip_file_name)
wideip_file = File.new(wideip_file_name, "w")
wideip_file.write(wip_info.to_yaml)
wideip_file.close

Reading ...

ooga = {}
ooga = YAML.load(File.read("rvcpbt1utigb01a-wideips.txt"))

Sample of YAML file ...

? !ruby/string:Nori::StringWithAttributes
  str: 100south-42tn.pax.iglbam1.bankofamerica.com
  attributes: {}
: :pools:
  - :pool_name: !ruby/string:Nori::StringWithAttributes
      str: 100south-42tn_pax_PRI
      attributes:
        s:type: y:string
    :members:
    - :member: 131.208.86.221:9100
    - :member: 131.208.113.221:9100

Add a code snippet to your website: www.paste.org