Skip to content

Instantly share code, notes, and snippets.

@nicotaing
Created August 19, 2011 01:56
Show Gist options
  • Select an option

  • Save nicotaing/1155819 to your computer and use it in GitHub Desktop.

Select an option

Save nicotaing/1155819 to your computer and use it in GitHub Desktop.
YAML conversion to redis
["featured_sections.yml", "team.yml","press_articles.yml"].each do |yr|
text = File.read(Rails.root.join("config/#{yr}"))
$redis.set("yaml_record:" + yr, text)
puts "#{yr}: yes!" if text == $redis.get("yaml_record:" + yr)
end
["partner_shows.yml", "faq.yml"].each do |sf|
text = File.read(Rails.root.join("config/#{sf}"))
$redis.set("simple_yaml:" + sf, text)
puts "#{sf}: yes!" if text == $redis.get("simple_yaml:" + sf)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment