Make install types and labels constant

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-08-15 17:47:57 -04:00
parent f962ef2662
commit 8d80c89e56

View file

@ -6,6 +6,14 @@ require "inspec/dist"
module InspecPlugins module InspecPlugins
module PluginManager module PluginManager
class CliCommand < Inspec.plugin(2, :cli_command) class CliCommand < Inspec.plugin(2, :cli_command)
INSTALL_TYPE_LABELS = {
bundle: "core", # Calling this core, too - not much of a distinction
core: "core",
path: "path",
user_gem: "gem (user)",
system_gem: "gem (system)",
}.freeze
include Inspec::Dist include Inspec::Dist
subcommand_desc "plugin SUBCOMMAND", "Manage #{PRODUCT_NAME} and Train plugins" subcommand_desc "plugin SUBCOMMAND", "Manage #{PRODUCT_NAME} and Train plugins"
@ -502,13 +510,7 @@ module InspecPlugins
end end
def make_pretty_install_type(status) def make_pretty_install_type(status)
{ INSTALL_TYPE_LABELS[status.installation_type]
bundle: "core", # Calling this core, too - not much of a distinction
core: "core",
path: "path",
user_gem: "gem (user)",
system_gem: "gem (system)",
}[status.installation_type]
end end
end end
end end