Sha256: 8be70ba04a3d5c322f2eead1e25c3c121aa32b8f99cc1fb7ec4c9948472d31c4
Contents?: true
Size: 379 Bytes
Versions: 15
Compression:
Stored size: 379 Bytes
Contents
# frozen_string_literal: true module Facter module InfoExtractor MEGABYTES_EXPONENT = 1024**2 GIGABYTES_EXPONENT = 1024**3 def self.extract(content, regex) content = content.each_line.map do |line| next unless regex =~ line line.split(/:\s*|\s{2,}/) end content.flatten!.reject!(&:nil?) Hash[*content] end end end
Version data entries
15 entries across 15 versions & 1 rubygems