Class: Pkgpurge::CLI

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

Instance Method Summary collapse

Instance Method Details

#ls(path) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/pkgpurge/cli.rb', line 7

def ls(path)
  root = Receipt.new(path).root

  Entry.traverse_entry_with_path(root, "/") do |entry, path|
    report path, "%o" % entry.mode, entry.uid, entry.gid, entry.size, entry.checksum
  end
end

#ls_purge(path) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pkgpurge/cli.rb', line 31

def ls_purge(path)
  root = Receipt.new(path).root

  traverse_purge_entry_with_path(root, "/") do |entry, path|
    if verify_entry(entry, path, options).empty?
      puts path
      true
    else
      false
    end
  end
end

#verify(path) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/pkgpurge/cli.rb', line 18

def verify(path)
  root = Receipt.new(path).root

  Entry.traverse_entry_with_path(root, "/") do |entry, path|
    verify_entry(entry, path, options).each do |modification|
      report path, *modification
    end
  end
end