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



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

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

.run(options = {}) ⇒ Object



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

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

.stringify_keys(hash) ⇒ Object



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

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

.subclassesObject



9
10
11
# File 'lib/jekyll-import/importer.rb', line 9

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