Class: Jekyll::Cleaner

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

Overview

Handles the cleanup of a site's destination before it is built.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ Cleaner

Returns a new instance of Cleaner.


8
9
10
# File 'lib/jekyll/cleaner.rb', line 8

def initialize(site)
  @site = site
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site


6
7
8
# File 'lib/jekyll/cleaner.rb', line 6

def site
  @site
end

Instance Method Details

#cleanup!Object

Cleans up the site's destination directory


13
14
15
16
# File 'lib/jekyll/cleaner.rb', line 13

def cleanup!
  FileUtils.rm_rf(obsolete_files)
  FileUtils.rm_rf() if @site.full_rebuild?
end