mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 17:28:29 -05:00
Refactor conditions for allowing plugins into a new method: Site#plguin_allowed?
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user