Class: Debci::Backend
- Inherits:
-
Object
- Object
- Debci::Backend
- Defined in:
- lib/debci/backend.rb
Class Method Summary collapse
- .default ⇒ Object
-
.select(package, arch) ⇒ Object
Select which backend to use for the given package.
Class Method Details
.default ⇒ Object
20 21 22 |
# File 'lib/debci/backend.rb', line 20 def self.default Debci.config.backend end |
.select(package, arch) ⇒ Object
Select which backend to use for the given package. The backend specified in the package backend
attribute will be used if that backend is available for the given architecture, or otherwise the default backend will be used as a fallback.
10 11 12 13 14 15 16 17 18 |
# File 'lib/debci/backend.rb', line 10 def self.select(package, arch) if package.backend && Debci::AMQP.queue_exists?(arch, package.backend) package.backend elsif Debci.config.backend_byarch_map.has_key?(arch) Debci.config.backend_byarch_map[arch] else default end end |