lib/jekyll/jekyll-import/wordpress.rb in jekyll-import-0.1.0.beta1 vs lib/jekyll/jekyll-import/wordpress.rb in jekyll-import-0.1.0.beta2
- old
+ new
@@ -1,9 +1,8 @@
require 'rubygems'
require 'sequel'
require 'fileutils'
-require 'psych'
require 'safe_yaml'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
@@ -48,13 +47,17 @@
# posts with matching status will be migrated.
# Known statuses are :publish, :draft, :private,
# and :revision. If this is nil or an empty
# array, all posts are migrated regardless of
# status. Default: [:publish].
- #
- def self.process(dbname, user, pass, host='localhost', options={})
+ #
+ def self.process(options={})
options = {
+ :user => '',
+ :pass => '',
+ :host => 'localhost',
+ :dbname => '',
:table_prefix => 'wp_',
:clean_entities => true,
:comments => true,
:categories => true,
:tags => true,
@@ -73,11 +76,11 @@
end
end
FileUtils.mkdir_p("_posts")
- db = Sequel.mysql(dbname, :user => user, :password => pass,
- :host => host, :encoding => 'utf8')
+ db = Sequel.mysql2(options[:dbname], :user => options[:user], :password => options[:pass],
+ :host => options[:host], :encoding => 'utf8')
px = options[:table_prefix]
posts_query = "
SELECT