Module: PuppetfileResolver::Util

Defined in:
lib/puppetfile-resolver/util.rb

Class Method Summary collapse

Class Method Details

.static_ca_cert_fileObject



19
20
21
# File 'lib/puppetfile-resolver/util.rb', line 19

def self.static_ca_cert_file
  @static_ca_cert_file ||= File.expand_path(File.join(__dir__, 'data', 'ruby_ca_certs.pem'))
end

.symbolise_object(object) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/puppetfile-resolver/util.rb', line 5

def self.symbolise_object(object)
  case # rubocop:disable Style/EmptyCaseCondition Ignore
  when object.is_a?(Hash)
    object.inject({}) do |memo, (k, v)| # rubocop:disable Style/EachWithObject Ignore
      memo[k.to_sym] = symbolise_object(v)
      memo
    end
  when object.is_a?(Array)
    object.map { |i| symbolise_object(i) }
  else
    object
  end
end