From 8d80c89e568ad91a13b072f73f64f13af3c90fa9 Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Thu, 15 Aug 2019 17:47:57 -0400 Subject: [PATCH] Make install types and labels constant Signed-off-by: Clinton Wolfe --- .../lib/inspec-plugin-manager-cli/cli_command.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb b/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb index e393ff36a..6df89b3dd 100644 --- a/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +++ b/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb @@ -6,6 +6,14 @@ require "inspec/dist" module InspecPlugins module PluginManager 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 subcommand_desc "plugin SUBCOMMAND", "Manage #{PRODUCT_NAME} and Train plugins" @@ -502,13 +510,7 @@ module InspecPlugins end def make_pretty_install_type(status) - { - 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] + INSTALL_TYPE_LABELS[status.installation_type] end end end