yast / yast-yast2

YaST module yast2
http://en.opensuse.org/Portal:YaST
GNU General Public License v2.0
54 stars 44 forks source link

[RFC] Software management API proposal #1201

Closed imobachgs closed 2 years ago

imobachgs commented 2 years ago

This PR implements a tentative API for software management. It is still a WIP, but it serves as an indication of the direction we are following.

An example

require "y2packager/software_manager"
require "y2packager/libzypp_backend"

manager = Y2Packager::SoftwareManager.new
manager.probe # Initialize the software stack
query = manager.search.with(kind: :product)
query.each do |product|
  puts product.name
end

# you can extend the query later
query.with(name: "SLES")
query.first&.name #=> "SLES"

Pending

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.01%) to 41.23% when pulling 6af7e8b8b5d165619df2a4d9749b06f06be38dd7 on packager-ng-model into 25a8bb990c4b9e81d2af2c4a699288dd95f90900 on master.

imobachgs commented 2 years ago

We are following a more conservative approach.