Skip to content

Commit

Permalink
Fix plugin loading
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ekohl committed Oct 20, 2022
1 parent 47ffa8a commit c455f9c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/puppet-lint/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ class PuppetLint::Plugins
#
# Returns nothing.
def self.load_from_gems
plugins_directories = gem_directories.select do |directory|
(directory + 'puppet-lint/plugins').to_s if (directory + 'puppet-lint/plugins').directory?
end

plugin_files = plugins_directories.each do |directory|
Dir["#{directory}/**/*.rb"]
end
gem_directories.each do |directory|
path = directory + 'puppet-lint/plugins'
next unless path.directory?

plugin_files.each do |file|
load(file)
Dir["#{path}/**/*.rb"].each do |file|
load(file)
end
end
end

Expand Down

0 comments on commit c455f9c

Please sign in to comment.