Class: Debci::Package
- Inherits:
-
Struct
- Object
- Struct
- Debci::Package
- Defined in:
- lib/debci/package.rb
Overview
This class represents a single package. See Debci::Repository for how to obtain one of these.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
-
#architectures ⇒ Object
Returns the architectures in which this package is available.
- #blacklisted? ⇒ Boolean
-
#fail_or_neutral ⇒ Object
Returns an Array of statuses where this package is failing or neutral.
-
#failures ⇒ Object
Returns an Array of statuses where this package is failing.
-
#history(suite, architecture) ⇒ Object
Returns an array of Debci::Status objects that represent the test history for this package.
-
#news ⇒ Object
Returns a list of Debci::Status objects that are newsworthy for this package.
- #prefix ⇒ Object
-
#status ⇒ Object
Returns a matrix of Debci::Status objects, where rows represent architectures and columns represent suites:.
-
#suites ⇒ Object
Returns the suites in which this package is available.
-
#tmpfail ⇒ Object
Returns an Array of statuses where this package is temporarily failing.
- #to_s ⇒ Object
- #to_str ⇒ Object
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
6 7 8 |
# File 'lib/debci/package.rb', line 6 def name @name end |
#repository ⇒ Object
Returns the value of attribute repository
6 7 8 |
# File 'lib/debci/package.rb', line 6 def repository @repository end |
Instance Method Details
#architectures ⇒ Object
Returns the architectures in which this package is available
9 10 11 |
# File 'lib/debci/package.rb', line 9 def architectures repository.architectures_for(self) end |
#blacklisted? ⇒ Boolean
74 75 76 |
# File 'lib/debci/package.rb', line 74 def blacklisted? Debci.blacklist.include?(self) end |
#fail_or_neutral ⇒ Object
Returns an Array of statuses where this package is failing or neutral.
50 51 52 |
# File 'lib/debci/package.rb', line 50 def fail_or_neutral status.flatten.select { |p| p.status == :fail or p.status == :neutral } end |
#failures ⇒ Object
Returns an Array of statuses where this package is failing.
45 46 47 |
# File 'lib/debci/package.rb', line 45 def failures status.flatten.select { |p| p.status == :fail } end |
#history(suite, architecture) ⇒ Object
Returns an array of Debci::Status objects that represent the test history for this package
33 34 35 |
# File 'lib/debci/package.rb', line 33 def history(suite, architecture) repository.history_for(self, suite, architecture) end |
#news ⇒ Object
Returns a list of Debci::Status objects that are newsworthy for this package. The list is sorted with the most recent entries first and the older entries last.
40 41 42 |
# File 'lib/debci/package.rb', line 40 def news repository.news_for(self) end |
#prefix ⇒ Object
69 70 71 72 |
# File 'lib/debci/package.rb', line 69 def prefix name =~ /^((lib)?.)/ $1 end |
#status ⇒ Object
Returns a matrix of Debci::Status objects, where rows represent architectures and columns represent suites:
[
[ amd64_unstable , amd64_testing ],
[ i386_unstable, i386_testing ],
]
Each cell of the matrix contains a Debci::Status object.
27 28 29 |
# File 'lib/debci/package.rb', line 27 def status repository.status_for(self) end |
#suites ⇒ Object
Returns the suites in which this package is available
14 15 16 |
# File 'lib/debci/package.rb', line 14 def suites repository.suites_for(self) end |
#tmpfail ⇒ Object
Returns an Array of statuses where this package is temporarily failing. If
55 56 57 |
# File 'lib/debci/package.rb', line 55 def tmpfail status.flatten.select { |p| p.status == :tmpfail } end |
#to_s ⇒ Object
59 60 61 62 |
# File 'lib/debci/package.rb', line 59 def to_s # :nodoc: "<Package #{name}>" end |
#to_str ⇒ Object
64 65 66 67 |
# File 'lib/debci/package.rb', line 64 def to_str # :nodoc: name end |