From d28858a9e96447e3fb5058807254cbc4caa9c577 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Mon, 19 Aug 2013 20:15:54 +0200 Subject: [PATCH] put the Cleaner instance in a `Site#site_cleaner` method --- lib/jekyll/site.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 51ee135a..7f2cda2e 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -3,7 +3,7 @@ module Jekyll attr_accessor :config, :layouts, :posts, :pages, :static_files, :categories, :exclude, :include, :source, :dest, :lsi, :pygments, :permalink_style, :tags, :time, :future, :safe, :plugins, :limit_posts, - :show_drafts, :keep_files, :baseurl, :site_cleaner + :show_drafts, :keep_files, :baseurl attr_accessor :converters, :generators @@ -87,8 +87,6 @@ module Jekyll self.converters = instantiate_subclasses(Jekyll::Converter) self.generators = instantiate_subclasses(Jekyll::Generator) - - self.site_cleaner = Cleaner.new(self) end # Internal: Setup the plugin search path @@ -228,7 +226,7 @@ module Jekyll # # Returns nothing. def cleanup - self.site_cleaner.cleanup! + site_cleaner.cleanup! end # Write static files, pages, and posts. @@ -386,5 +384,9 @@ module Jekyll limit = self.posts.length < limit_posts ? self.posts.length : limit_posts self.posts = self.posts[-limit, limit] end + + def site_cleaner + @site_cleaner ||= Cleaner.new(self) + end end end