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)
-
- (Object) name
Returns the value of attribute name.
-
- (Object) repository
Returns the value of attribute repository.
Instance Method Summary (collapse)
-
- (Object) architectures
Returns the architectures in which this package is available.
- - (Boolean) blacklisted?
-
- (Object) failures
Returns an array containing the suite/architectures this package is failing.
-
- (Object) history(suite, architecture)
Returns an array of Debci::Status objects that represent the test history for this package.
-
- (Object) news
Returns a list of Debci::Status objects that are newsworthy for this package.
- - (Object) prefix
-
- (Object) status
Returns a matrix of Debci::Status objects, where rows represent architectures and columns represent suites:.
-
- (Object) suites
Returns the suites in which this package is available.
-
- (Object) tmpfail
Returns an Array of suite/architectures that this package is temporarily failing.
- - (Object) to_s
- - (Object) to_str
Instance Attribute Details
- (Object) name
Returns the value of attribute name
6 7 8 |
# File 'lib/debci/package.rb', line 6 def name @name end |
- (Object) repository
Returns the value of attribute repository
6 7 8 |
# File 'lib/debci/package.rb', line 6 def repository @repository end |
Instance Method Details
- (Object) architectures
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 |
- (Boolean) blacklisted?
99 100 101 |
# File 'lib/debci/package.rb', line 99 def blacklisted? Debci.blacklist.include?(self) end |
- (Object) failures
Returns an array containing the suite/architectures this package is failing. If this package is passing on all suite/architectures, nothing is returned.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/debci/package.rb', line 47 def failures failing_status = [] status.each do |architecture| architecture.each do |suite| case suite.status when :tmpfail # Determine if there was a failure before the tmpfail history(suite.suite, suite.architecture).each do |test| # If there wasn't a failure before the tmpfail, # stop looking through the test history if test.status == :pass break end if test.status == :fail failing_status.push(suite.suite + '/' + suite.architecture) break end end when :fail failing_status.push(suite.suite + '/' + suite.architecture) end end end return failing_status unless failing_status.empty? end |
- (Object) history(suite, architecture)
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 |
- (Object) news
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 |
- (Object) prefix
94 95 96 97 |
# File 'lib/debci/package.rb', line 94 def prefix name =~ /^((lib)?.)/ $1 end |
- (Object) status
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 |
- (Object) suites
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 |
- (Object) tmpfail
Returns an Array of suite/architectures that this package is temporarily failing. If there are no temporary failures, nothing is returned.
80 81 82 |
# File 'lib/debci/package.rb', line 80 def tmpfail status.flatten.select { |p| p.status == :tmpfail }.map { |s| "#{s.suite}/#{s.architecture}" } end |
- (Object) to_s
84 85 86 87 |
# File 'lib/debci/package.rb', line 84 def to_s # :nodoc: "<Package #{name}>" end |
- (Object) to_str
89 90 91 92 |
# File 'lib/debci/package.rb', line 89 def to_str # :nodoc: name end |