# File lib/jekyll/migrators/mephisto.rb, line 43
    def self.process(dbname, user, pass, host = 'localhost')
      db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)

      FileUtils.mkdir_p "_posts"

      db[QUERY].each do |post|
        title = post[:title]
        slug = post[:permalink]
        date = post[:published_at]
        content = post[:body]
#         more_content = ''

        # Be sure to include the body and extended body.
#         if more_content != nil
#           content = content + " \n" + more_content
#         end

        # Ideally, this script would determine the post format (markdown, html
        # , etc) and create files with proper extensions. At this point it
        # just assumes that markdown will be acceptable.
        name = [date.year, date.month, date.day, slug].join('-') + ".markdown"

        data = {
           'layout' => 'post',
           'title' => title.to_s,
           'mt_id' => post[:entry_id],
         }.delete_if { |k,v| v.nil? || v == ''}.to_yaml

        File.open("_posts/#{name}", "w") do |f|
          f.puts data
          f.puts "---"
          f.puts content
        end
      end

    end