Refactor conditions for allowing plugins into a new method: Site#plguin_allowed?

This commit is contained in:
Parker Moore 2013-12-06 00:26:44 -05:00
parent 249b13a98a
commit f0fbc8f356
1 changed files with 5 additions and 1 deletions

View File

@ -98,12 +98,16 @@ module Jekyll
def require_gems
self.gems.each do |gem|
if whitelist.include?(gem) || !self.safe
if plugin_allowed?(gem)
require gem
end
end
end
def plugin_allowed?(name)
whitelist.include?(gem_name) || !self.safe
end
def whitelist
@whitelist ||= Array[self.config['whitelist']].flatten || []
end