Class: JekyllImport::Importers::Ghost

Inherits:
JekyllImport::Importer show all
Defined in:
lib/jekyll-import/importers/ghost.rb

Class Method Summary collapse

Methods inherited from JekyllImport::Importer

inherited, run, stringify_keys, subclasses

Class Method Details

.process(options) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/jekyll-import/importers/ghost.rb', line 18

def self.process(options)
  posts = fetch_posts(options.fetch('dbfile', 'ghost.db'))
  if !posts.empty?
    FileUtils.mkdir_p("_posts")
    FileUtils.mkdir_p("_drafts")
    posts.each do |post|
      write_post_to_file(post)
    end
  end
end

.require_depsObject



9
10
11
12
13
14
15
16
# File 'lib/jekyll-import/importers/ghost.rb', line 9

def self.require_deps
  JekyllImport.require_with_fallback(%w[
    rubygems
    sequel
    fileutils
    safe_yaml
  ])
end

.specify_options(c) ⇒ Object



5
6
7
# File 'lib/jekyll-import/importers/ghost.rb', line 5

def self.specify_options(c)
  c.option 'dbfile', '--dbfile', 'Database file (default: ghost.db)'
end