mirror of
https://github.com/inspec/inspec
synced 2024-11-13 08:27:08 +00:00
Convert the plugin name to a string only once when guessing at versions
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
1b7a8f3888
commit
f44c7bcdcd
1 changed files with 2 additions and 1 deletions
|
@ -499,8 +499,9 @@ module InspecPlugins
|
|||
# Assume it is a version constraint string and try to resolve
|
||||
# TODO: this is naive, and assumes the latest version is the one that will be used. Logged on #3317
|
||||
# In fact, the logic to determine "what version would be used" belongs in the Loader.
|
||||
plugin_name = status.name.to_s
|
||||
Inspec::Plugin::V2::Loader.list_installed_plugin_gems
|
||||
.select { |spec| spec.name == status.name.to_s }
|
||||
.select { |spec| spec.name == plugin_name }
|
||||
.sort_by(&:version)
|
||||
.last.version
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue