Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Created August 26, 2015 13:55
Show Gist options
  • Save mariusbutuc/2e71b859b3882172bc5f to your computer and use it in GitHub Desktop.
Save mariusbutuc/2e71b859b3882172bc5f to your computer and use it in GitHub Desktop.
CSV_FILENAME = 'config/items.csv'.freeze
YML_FILENAME = 'config/items.yml'.freeze
File.open(YML_FILENAME, 'w') do |f|
f.puts(CSV.table(CSV_FILENAME).map(&:to_hash).to_yaml)
end
YAML.load(File.new(YML_FILENAME))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment