Created
August 19, 2011 01:56
-
-
Save nicotaing/1155819 to your computer and use it in GitHub Desktop.
YAML conversion to redis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ["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