Skip to content

Commit c455f9c

Browse files
committed
Fix plugin loading
In ed5ec22 the method was refactored, but it ended up only loading the plugin directory itself, which isn't a file. It now loads all Ruby files again Fixes: ed5ec22
1 parent 47ffa8a commit c455f9c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lib/puppet-lint/plugins.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ class PuppetLint::Plugins
1010
#
1111
# Returns nothing.
1212
def self.load_from_gems
13-
plugins_directories = gem_directories.select do |directory|
14-
(directory + 'puppet-lint/plugins').to_s if (directory + 'puppet-lint/plugins').directory?
15-
end
16-
17-
plugin_files = plugins_directories.each do |directory|
18-
Dir["#{directory}/**/*.rb"]
19-
end
13+
gem_directories.each do |directory|
14+
path = directory + 'puppet-lint/plugins'
15+
next unless path.directory?
2016

21-
plugin_files.each do |file|
22-
load(file)
17+
Dir["#{path}/**/*.rb"].each do |file|
18+
load(file)
19+
end
2320
end
2421
end
2522

0 commit comments

Comments
 (0)