Class: Xezat::Command::Doctor
- Inherits:
-
Object
- Object
- Xezat::Command::Doctor
- Includes:
- Xezat
- Defined in:
- lib/xezat/command/doctor.rb
Constant Summary
Constants included from Xezat
DATA_DIR, INI_FILE, LOG, REPOSITORY_DIR, ROOT_DIR, TEMPLATE_DIR, VERSION
Instance Method Summary collapse
- #execute ⇒ Object
- #get_contents_uniqueness(path = '/etc/setup') ⇒ Object
-
#initialize ⇒ Doctor
constructor
A new instance of Doctor.
Methods included from Xezat
#config, #packages, #variables
Constructor Details
#initialize ⇒ Doctor
Returns a new instance of Doctor.
8 9 |
# File 'lib/xezat/command/doctor.rb', line 8 def initialize end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 |
# File 'lib/xezat/command/doctor.rb', line 11 def execute get_contents_uniqueness.each do |path, pkg| puts "#{path} is not unique: #{pkg}" if pkg.length > 1 end end |
#get_contents_uniqueness(path = '/etc/setup') ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/xezat/command/doctor.rb', line 17 def get_contents_uniqueness(path = '/etc/setup') content2pkg = {} Dir.glob(File.join(path, '*.lst.gz')) do |lst| pkg = File.basename(lst, '.lst.gz').intern Zlib::GzipReader.open(lst) do |gz| gz.each_line do |line| line.strip! next if line.end_with?('/') path = line.intern content2pkg[path] = [] unless content2pkg.key?(path) content2pkg[path] << pkg end end end content2pkg end |