Sha256: 37a69e848fcc40face816d3e25c74d9d9a6e4ae31a158eb3a6f7c9f22b05e1e1

Contents?: true

Size: 635 Bytes

Versions: 4

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

module PuppetfileResolver
  module Util
    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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppetfile-resolver-0.4.0 lib/puppetfile-resolver/util.rb
puppetfile-resolver-0.3.0 lib/puppetfile-resolver/util.rb
puppetfile-resolver-0.2.0 lib/puppetfile-resolver/util.rb
puppetfile-resolver-0.1.0 lib/puppetfile-resolver/util.rb