diff --git a/History.txt b/History.txt index fb2bc97c..ef9a75ee 100644 --- a/History.txt +++ b/History.txt @@ -10,6 +10,7 @@ * Better error message for invalid post date (#291) * Print formatted fatal exceptions to stdout on build failure * Add Tumblr importer (#323) + * Add Enki importer (#320) * Bug Fixes * Secure additional path exploits diff --git a/bin/jekyll b/bin/jekyll index ffe089bd..753eedad 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -161,6 +161,7 @@ if ARGV.size > 0 :wordpress => 'Wordpress', :csv => 'CSV', :drupal => 'Drupal', + :enki => 'Enki', :mephisto => 'Mephisto', :mt => 'MT', :textpattern => 'TextPattern', diff --git a/lib/jekyll/migrators/enki.rb b/lib/jekyll/migrators/enki.rb index a3e715c9..61cb2562 100644 --- a/lib/jekyll/migrators/enki.rb +++ b/lib/jekyll/migrators/enki.rb @@ -8,19 +8,19 @@ require 'sequel' module Jekyll module Enki SQL = <<-EOS - SELECT p.id, - p.title, - p.slug, - p.body, - p.published_at as date, - p.cached_tag_list as tags + SELECT p.id, + p.title, + p.slug, + p.body, + p.published_at as date, + p.cached_tag_list as tags FROM posts p EOS - # just working with postgres, but can be easily adapted - # to work with both mysql and postgres - def self.process(dbname, user, pass, host='localhost') - FileUtils.mkdir_p '_posts' + # Just working with postgres, but can be easily adapted + # to work with both mysql and postgres. + def self.process(dbname, user, pass, host = 'localhost') + FileUtils.mkdir_p('_posts') db = Sequel.postgres(:database => dbname, :user => user, :password => pass, @@ -28,7 +28,6 @@ module Jekyll :encoding => 'utf8') db[SQL].each do |post| - name = [ sprintf("%.04d", post[:date].year), sprintf("%.02d", post[:date].month), sprintf("%.02d", post[:date].day), @@ -46,6 +45,5 @@ module Jekyll end end end - - end # module Enki -end # module Jekyll \ No newline at end of file + end +end