File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,13 @@ def initialize(config)
1818 self . safe = config [ 'safe' ]
1919 self . source = File . expand_path ( config [ 'source' ] )
2020 self . dest = File . expand_path ( config [ 'destination' ] )
21- self . plugins = File . expand_path ( config [ 'plugins' ] )
21+ self . plugins = if config [ 'plugins' ] . respond_to? ( 'each' )
22+ # If plugins is an array, process it.
23+ config [ 'plugins' ] . each { |directory | File . expand_path ( directory ) }
24+ else
25+ # Otherwise process a single entry as an array.
26+ [ File . expand_path ( config [ 'plugins' ] ) ]
27+ end
2228 self . lsi = config [ 'lsi' ]
2329 self . pygments = config [ 'pygments' ]
2430 self . permalink_style = config [ 'permalink' ] . to_sym
@@ -72,8 +78,10 @@ def setup
7278 # If safe mode is off, load in any Ruby files under the plugins
7379 # directory.
7480 unless self . safe
75- Dir [ File . join ( self . plugins , "**/*.rb" ) ] . each do |f |
76- require f
81+ self . plugins . each do |plugins |
82+ Dir [ File . join ( plugins , "**/*.rb" ) ] . each do |f |
83+ require f
84+ end
7785 end
7886 end
7987
You can’t perform that action at this time.
0 commit comments