Class: JekyllImport::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-import/importer.rb

Class Method Summary collapse

Class Method Details

.inherited(base) ⇒ Object



3
4
5
# File 'lib/jekyll-import/importer.rb', line 3

def self.inherited(base)
  subclasses << base
end

.run(options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/jekyll-import/importer.rb', line 19

def self.run(options = {})
  opts = stringify_keys(options)
  self.require_deps
  self.validate(opts) if self.respond_to?(:validate)
  self.process(opts)
end

.stringify_keys(hash) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/jekyll-import/importer.rb', line 11

def self.stringify_keys(hash)
  the_hash = hash.clone
  the_hash.keys.each do |key|
    the_hash[(key.to_s rescue key) || key] =  the_hash.delete(key)
  end
  the_hash
end

.subclassesObject



7
8
9
# File 'lib/jekyll-import/importer.rb', line 7

def self.subclasses
  @subclasses ||= []
end