Class: Packages::CommitResult
- Inherits:
-
Object
- Object
- Packages::CommitResult
- Defined in:
- library/packages/src/lib/packages/commit_result.rb
Overview
Commit results coming from libzypp
Instance Attribute Summary collapse
-
#committed ⇒ Object
readonly
Returns the value of attribute committed.
-
#failed ⇒ Object
readonly
Returns the value of attribute failed.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#srcremaining ⇒ Object
readonly
Returns the value of attribute srcremaining.
-
#successful ⇒ Object
readonly
Returns the value of attribute successful.
-
#update_messages ⇒ Object
readonly
Returns the value of attribute update_messages.
Class Method Summary collapse
-
.build_update_messages(messages) ⇒ Array<Packager::UpdateMessage>
Convert an array of hash into an array of UpdateMessage objects.
-
.from_result(result) ⇒ Object
Construct an instance taking as input the Pkg.Commit or Pkg.PkgCommit output.
Instance Method Summary collapse
-
#initialize(successful, failed, remaining, srcremaining, update_messages) ⇒ CommitResult
constructor
Constructor.
Constructor Details
#initialize(successful, failed, remaining, srcremaining, update_messages) ⇒ CommitResult
Constructor
52 53 54 55 56 57 58 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 52 def initialize(successful, failed, remaining, srcremaining, ) @successful = successful @failed = failed || [] @remaining = remaining || [] @srcremaining = srcremaining || [] @update_messages = || [] end |
Instance Attribute Details
#committed ⇒ Object (readonly)
Returns the value of attribute committed.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def committed @committed end |
#failed ⇒ Object (readonly)
Returns the value of attribute failed.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def failed @failed end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def remaining @remaining end |
#srcremaining ⇒ Object (readonly)
Returns the value of attribute srcremaining.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def srcremaining @srcremaining end |
#successful ⇒ Object (readonly)
Returns the value of attribute successful.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def successful @successful end |
#update_messages ⇒ Object (readonly)
Returns the value of attribute update_messages.
6 7 8 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 6 def @update_messages end |
Class Method Details
.build_update_messages(messages) ⇒ Array<Packager::UpdateMessage>
Convert an array of hash into an array of UpdateMessage objects
Each hash contains the following keys/values:
- solvable: solvable name (usually package names).
- text: message text.
- installationPath: path to the libzypp's file containing the message after installation.
- currentPath: path to the libzypp's file containing the message currently. It will differ from installationPath when running inst-sys.
34 35 36 37 38 39 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 34 def () .map do |msg| Packages::UpdateMessage.new(msg["solvable"], msg["text"], msg["installationPath"], msg["currentPath"]) end end |
.from_result(result) ⇒ Object
Construct an instance taking as input the Pkg.Commit or Pkg.PkgCommit output
Pkg.Commit and Pkg.PkcCommit return an array with the following elements: [successful, failed, remaining, srcremaining, update_messages].
15 16 17 18 |
# File 'library/packages/src/lib/packages/commit_result.rb', line 15 def from_result(result) = (result[4] || []) new(result[0], result[1], result[2], result[3], ) end |