Module: Inspec::InstallContextHelpers

Included in:
Inspec
Defined in:
lib/inspec/utils/install_context.rb

Overview

Heuristics to determine how InSpec was installed.

Instance Method Summary collapse

Instance Method Details

#guess_install_contextObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/inspec/utils/install_context.rb', line 6

def guess_install_context
  # These all work by simple path recognition
  return "chef-workstation" if chef_workstation_install?
  return "omnibus" if omnibus_install?
  return "chefdk" if chefdk_install?
  return "habitat" if habitat_install?

  # Order matters here - gem mode is easily mistaken for one of the above
  return "docker" if docker_install?
  return "rubygem" if rubygem_install?

  return "source" if source_install?

  "unknown"
end