Sha256: a2d99bf6039ba17d90a912be6a9fa454b8acd0c9b1cf134a2663e5c57a9cd35c

Contents?: true

Size: 659 Bytes

Versions: 19

Compression:

Stored size: 659 Bytes

Contents

require_relative "utils/install_context"

module Inspec
  extend Inspec::InstallContextHelpers

  def self.config_dir
    ENV["INSPEC_CONFIG_DIR"] || File.join(home_path, ".inspec")
  end

  def self.src_root
    @src_root ||= File.expand_path(File.join(__FILE__, "../../.."))
  end

  def self.home_path
    Dir.home
  rescue ArgumentError, NoMethodError
    # If ENV['HOME'] is not set, Dir.home will fail due to expanding the ~. Fallback to Etc.
    require "etc" unless defined?(Etc)
    Etc.getpwuid.dir
  end

  def self.locally_windows?
    require "rbconfig" unless defined?(RbConfig)
    RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
inspec-core-5.22.58 lib/inspec/globals.rb
inspec-core-5.22.55 lib/inspec/globals.rb
inspec-core-5.22.40 lib/inspec/globals.rb
inspec-core-5.22.36 lib/inspec/globals.rb
inspec-core-5.22.29 lib/inspec/globals.rb
inspec-core-4.56.58 lib/inspec/globals.rb
inspec-core-5.22.3 lib/inspec/globals.rb
inspec-core-5.21.29 lib/inspec/globals.rb
inspec-core-5.18.14 lib/inspec/globals.rb
inspec-core-5.17.4 lib/inspec/globals.rb
inspec-core-5.14.0 lib/inspec/globals.rb
inspec-core-4.56.20 lib/inspec/globals.rb
inspec-core-5.12.2 lib/inspec/globals.rb
inspec-core-5.10.5 lib/inspec/globals.rb
inspec-core-4.56.19 lib/inspec/globals.rb
inspec-core-5.7.9 lib/inspec/globals.rb
inspec-core-4.56.17 lib/inspec/globals.rb
inspec-core-4.52.9 lib/inspec/globals.rb
inspec-core-4.50.3 lib/inspec/globals.rb