Have a list of blessed gems to require and load.

This commit is contained in:
Parker Moore 2014-03-16 01:18:39 -04:00
parent e746b3bd5f
commit 8e9644a8a2
1 changed files with 7 additions and 25 deletions

View File

@ -6,6 +6,13 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
require 'jekyll'
require 'mercenary'
%w[jekyll-import].each do |blessed_gem|
begin
require blessed_gem
rescue LoadError
end
end
Jekyll::Deprecator.process(ARGV)
Mercenary.program(:jekyll) do |p|
@ -30,29 +37,4 @@ Mercenary.program(:jekyll) do |p|
end
end
end
p.command(:import) do |c|
c.syntax 'import <platform> [options]'
c.description 'Import your old blog to Jekyll'
importers = []
begin
require 'jekyll-import'
importers = JekyllImport.add_importer_commands(c)
rescue LoadError
end
c.action do |args, options|
unless Object.const_defined?(:JekyllImport)
msg = "You must install the 'jekyll-import' gem before continuing.\n"
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
abort msg
end
if args.empty?
Jekyll.logger.warn "You must specify an importer."
Jekyll.logger.info "Valid options are:"
importers.each { |i| Jekyll.logger.info "*", "#{i}" }
end
end
end
end