Class: Packit::Packager

Inherits:
Object
  • Object
show all
Defined in:
lib/packit/packager.rb

Direct Known Subclasses

DpkgDeb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(debconf) ⇒ Packager

Returns a new instance of Packager.



20
21
22
23
# File 'lib/packit/packager.rb', line 20

def initialize(debconf)
  @debconf = debconf
  @control = Control.render(@debconf)
end

Class Method Details

.pack(config: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/packit/packager.rb', line 6

def self.pack(config: nil)
  config ||= File.join(Dir.pwd, 'packit.yml')
  debconf = Config.load(config)

  case debconf.strategy
  when 'simple'
    DpkgDeb.new(debconf).package
  when 'pbuilder'
    Pbuilder.new(debconf).package
  else
    "Build strategy #{config.strategy} is not supported"
  end
end