Method: Licensed::Sources::Cabal#package_info

Defined in:
lib/licensed/sources/cabal.rb

#package_info(id) ⇒ Object

Returns package information as a hash for the given id



116
117
118
119
120
121
122
123
124
125
126
# File 'lib/licensed/sources/cabal.rb', line 116

def package_info(id)
  info = package_info_command(id).strip
  return missing_package(id) if info.empty?

  info.lines.each_with_object({}) do |line, hsh|
    key, value = line.split(":", 2).map(&:strip)
    next unless key && value

    hsh[key] = value
  end
end