Module: PuppetLanguageServerSidecar::PuppetStringsHelper

Defined in:
lib/puppet-languageserver-sidecar/puppet_strings_helper.rb

Defined Under Namespace

Classes: Helper

Class Method Summary collapse

Class Method Details

.file_documentation(path, puppet_path, cache = nil) ⇒ Object



9
10
11
# File 'lib/puppet-languageserver-sidecar/puppet_strings_helper.rb', line 9

def self.file_documentation(path, puppet_path, cache = nil)
  instance.file_documentation(path, puppet_path, cache)
end

.instanceObject



5
6
7
# File 'lib/puppet-languageserver-sidecar/puppet_strings_helper.rb', line 5

def self.instance
  @instance ||= Helper.new
end

.require_puppet_stringsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/puppet-languageserver-sidecar/puppet_strings_helper.rb', line 13

def self.require_puppet_strings
  return @puppet_strings_loaded unless @puppet_strings_loaded.nil?

  begin
    require 'puppet-strings'
    require 'puppet-strings/yard'
    require 'puppet-strings/json'

    require File.expand_path(File.join(File.dirname(__FILE__), 'puppet_strings_monkey_patches'))
    @puppet_strings_loaded = true
  rescue LoadError => e
    PuppetLanguageServerSidecar.log_message(:error, "[PuppetStringsHelper::require_puppet_strings] Unable to load puppet-strings gem: #{e}")
    @puppet_strings_loaded = false
  end
  @puppet_strings_loaded
end

.setup_yard!Object



30
31
32
33
34
35
# File 'lib/puppet-languageserver-sidecar/puppet_strings_helper.rb', line 30

def self.setup_yard!
  unless @yard_setup # rubocop:disable Style/GuardClause
    ::PuppetStrings::Yard.setup!
    @yard_setup = true
  end
end