Class: Pandler::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pandler/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ CLI

Returns a new instance of CLI.



7
8
9
10
11
# File 'lib/pandler/cli.rb', line 7

def initialize(args=[], options={}, config={})
  super
  @chroot = Pandler::Chroot.new
  @yumrepo = Pandler::Yumrepo.new
end

Instance Method Details

#cleanObject



32
33
34
# File 'lib/pandler/cli.rb', line 32

def clean
  @chroot.clean
end

#exec(*cmd) ⇒ Object



37
38
39
# File 'lib/pandler/cli.rb', line 37

def exec(*cmd)
  @chroot.execute(*cmd)
end

#installObject



20
21
22
23
24
# File 'lib/pandler/cli.rb', line 20

def install
  @chroot.init
  @yumrepo.createrepo
  @chroot.install(*@yumrepo.install_pkgs)
end

#listObject



27
28
29
# File 'lib/pandler/cli.rb', line 27

def list
  puts @chroot.list
end

#versionObject



15
16
17
# File 'lib/pandler/cli.rb', line 15

def version
  puts Pandler::VERSION
end