Class: PFPuX

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

Instance Method Summary collapse

Constructor Details

#initialize(dir, target, msg = '') ⇒ PFPuX

Returns a new instance of PFPuX.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pfpux.rb', line 12

def initialize(dir, target, msg='')

  directories = rsync dir, target
  
  directories.each do |dirpath, files|
    
    dtx = DirToXML.new File.join(target, dirpath)

    files.each do |filename|
      
      row = dtx.find_by_filename filename
      next unless row

      row[:description] = msg
    end
          
    dtx.save

  end

end