lib/ohai/plugins/linux/platform.rb
def read_os_release_info(file)
    return nil unless File.exist?(file)
    File.read(file).split.inject({}) do |map, line|
      key, value = line.split("=")
      map[key] = value.gsub(/\A"|"\Z/, "") if value
      map
    end
  end
#
# Reads an os-release-info file and parse it into a hash
#
# @param file [String] the filename to read (e.g. '/etc/os-release')
#
# @returns [Hash] the file parsed into a Hash or nil
#
Reads an os-release-info file and parse it into a hash
Reads an os - release - info file and parse it into a hash
def read_os_release_info(file)
    return nil unless File.exist?(file)
    File.read(file).split.inject({}) do |map, line|
      key, value = line.split("=")
      map[key] = value.gsub(/\A"|"\Z/, "") if value
      map
    end
  end
def read_os_release_info ( file ) return nil unless File . exist? ( file ) File . read ( file ) . split . inject ( { } ) do | map , line | key , value = line . split ( "=" ) map [ key ] = value . gsub ( / \A "|" \Z / , "" ) if value map end end
Reads an os-release-info file and parse it into a hash
Reads an os - release - info file and parse it into a hash
[Hash] the file parsed into a Hash or nil
[ Hash ] the file parsed into a Hash or nil
file
the filename to read
the filename to read