Module: Hiera::Util

### Home Classes Methods

### In Files

- lib/hiera/util.rb

### Methods

- #common_appdata
- #config_dir
- #file_alt_separator
- #microsoft_windows?
- #posix?
- #var_dir

### Class/Module Index

Quicksearch

- Hiera
- Hiera::Backend
- Hiera::Backend::Json_backend
- Hiera::Backend::Yaml_backend
- Hiera::Config
- Hiera::Console_logger
- Hiera::Error
- Hiera::FallbackLogger
- Hiera::Filecache
- Hiera::Interpolate
- Hiera::InterpolationLoop
- Hiera::InvalidConfigurationError
- Hiera::Noop_logger
- Hiera::Puppet_logger
- Hiera::RecursiveGuard
- Hiera::Util

No matching classes.

# Hiera::Util

### Public Instance Methods

common_appdata() click to toggle source

    # File lib/hiera/util.rb, line 42
    def common_appdata
      Dir::COMMON_APPDATA
    end

config_dir() click to toggle source

    # File lib/hiera/util.rb, line 22
    def config_dir
      if microsoft_windows?
         File.join(common_appdata, 'PuppetLabs', 'hiera', 'etc')
      else
        '/etc'
      end
    end

file_alt_separator() click to toggle source

    # File lib/hiera/util.rb, line 38
    def file_alt_separator
      File::ALT_SEPARATOR
    end

microsoft_windows?() click to toggle source

    # File lib/hiera/util.rb, line 10
    def microsoft_windows?
      return false unless file_alt_separator

      begin
        require 'win32/dir'
        true
      rescue LoadError => err
        warn "Cannot run on Microsoft Windows without the win32-dir gem: #{err}"
        false
      end
    end

posix?() click to toggle source

    # File lib/hiera/util.rb, line 5
    def posix?
      require 'etc'
      Etc.getpwuid(0) != nil
    end

var_dir() click to toggle source

    # File lib/hiera/util.rb, line 30
    def var_dir
      if microsoft_windows?
        File.join(common_appdata, 'PuppetLabs', 'hiera', 'var')
      else
        '/var/lib/hiera'
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.