From 5788ca88f816f9c1f258f7ee9ae24ad81895a0b9 Mon Sep 17 00:00:00 2001 From: Nicholas Chen Date: Sat, 14 May 2011 10:09:59 -0700 Subject: [PATCH] Changed [:state] check RE and required YAML 1) The published state is actually stored as "published" in the database but the regular expression checks for "Published" and thus will actually skip all published posts. 2) The to_yaml method is not immediately available without the "require 'yaml'" directive. This caused the migration script to fail while executing it following the instructions. Tested with Typo 5.3 --- lib/jekyll/migrators/typo.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/migrators/typo.rb b/lib/jekyll/migrators/typo.rb index 3de5130a..adb8be96 100644 --- a/lib/jekyll/migrators/typo.rb +++ b/lib/jekyll/migrators/typo.rb @@ -2,6 +2,7 @@ require 'fileutils' require 'rubygems' require 'sequel' +require 'yaml' module Jekyll module Typo @@ -24,7 +25,7 @@ module Jekyll FileUtils.mkdir_p '_posts' db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8') db[SQL].each do |post| - next unless post[:state] =~ /Published/ + next unless post[:state] =~ /published/ name = [ sprintf("%.04d", post[:date].year), sprintf("%.02d", post[:date].month),