Require gems in :jekyll_plugins group in a Gemfile in unsafe mode.

Replaces #1658. /cc @imathis
This commit is contained in:
Parker Moore 2014-09-01 12:30:15 -07:00
parent 01b11d098e
commit 34de676713
1 changed files with 10 additions and 0 deletions

View File

@ -17,6 +17,7 @@ module Jekyll
def conscientious_require
require_plugin_files
require_gems
require_from_bundler
end
# Require each of the gem plugins specified.
@ -30,6 +31,15 @@ module Jekyll
end
end
def require_from_bundler
unless site.safe
require "bundler/setup"
Bundler.require(:jekyll_plugins)
end
rescue LoadError
false
end
# Check whether a gem plugin is allowed to be used during this build.
#
# gem_name - the name of the gem