Class: Puppet::Settings::EnvironmentConf

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-languageserver-sidecar/puppet_environment_monkey_patches.rb,
lib/puppet-languageserver-sidecar/puppet_modulepath_monkey_patches.rb

Overview

Monkey patch the environment. Normally it’s not possible to modify environment settings. Add a method to get the underlying environment settings which can be used to modify settings on the fly.

Instance Method Summary collapse

Instance Method Details

#get_raw_setting(setting_name) ⇒ Object



49
50
51
# File 'lib/puppet-languageserver-sidecar/puppet_environment_monkey_patches.rb', line 49

def get_raw_setting(setting_name)
  section.setting(setting_name) if section
end

#modulepathObject



118
119
120
121
122
123
124
125
126
# File 'lib/puppet-languageserver-sidecar/puppet_modulepath_monkey_patches.rb', line 118

def modulepath
  result = original_modulepath

  if PuppetLanguageServerSidecar::Workspace.has_module_metadata? # rubocop:disable Style/IfUnlessModifier  Nicer to read like this
    result = result + File::PATH_SEPARATOR + PuppetLanguageServerSidecar::Workspace.root_path
  end

  result
end

#original_modulepathObject



116
# File 'lib/puppet-languageserver-sidecar/puppet_modulepath_monkey_patches.rb', line 116

alias original_modulepath modulepath