Module: Buratino::Dirs
- Defined in:
- lib/buratino/dirs.rb
Class Method Summary collapse
- .check(config) ⇒ Object
-
.clean(config) ⇒ Object
Buratino::Hg.send_reports(config) end.
Class Method Details
.check(config) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/buratino/dirs.rb', line 8 def self.check(config) puts "DEBUG BURATINO::DIRS::CHECK" self.clean(config) @hostname = Facter.fqdn # Buratino::Hg.reports_dir(config) # Dir.mkdir("#{config['reports_dir']}/#{@hostname}") until File.exist? "#{config['reports_dir']}/#{@hostname}" end |
.clean(config) ⇒ Object
Buratino::Hg.send_reports(config)
end
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/buratino/dirs.rb', line 31 def self.clean(config) puts "DEBUG BURATINO::DIRS::CLEAN" case config['mode'] when 'clone' FileUtils.rm_r(config['destination'], :force => true) while File.exist? config['destination'] # FileUtils.rm_r(config['reports_dir'], :force => true) while File.exist? config['reports_dir'] when 'update' puts "No cleans in update mode" end end |