From a58827ce0f41aaee937ce3bcd7d59aa3b7a1e823 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 5 Jan 2013 23:55:58 -0500 Subject: [PATCH] read_yaml helper function --- source/downloads/code/migrator.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/downloads/code/migrator.rb b/source/downloads/code/migrator.rb index 50e8936..04fecee 100755 --- a/source/downloads/code/migrator.rb +++ b/source/downloads/code/migrator.rb @@ -23,6 +23,10 @@ def new_octo_dir(*subdirs) File.join(NEW_OCTO, *subdirs) end +def read_yaml(path) + YAML.load(File.read(path)) +end + begin # Make local copy of imathis/octopress FileUtils.rm_rf new_octo_dir @@ -44,7 +48,7 @@ begin FileUtils.cp_r new_octo_dir('.themes', 'classic'), old_octo_dir('.themes') # migrate configuration - local_config = YAML.load(File.read(old_octo_dir("_config.yml"))) + local_config = read_yaml(old_octo_dir("_config.yml")) FileUtils.mkdir_p old_octo_dir('_config') FileUtils.cp_r File.join(OCTO_CONFIG_DEST, 'defaults'), old_octo_dir('_config'), :verbose => true, :remove_destination => true