From 08b49ec9db3d814dc84f4b397741f2799b042c82 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 8 May 2013 22:02:23 -0500 Subject: [PATCH] Update the display of the LSI progress output It now fits more in line with what the other messages display. --- lib/jekyll/related_posts.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/jekyll/related_posts.rb b/lib/jekyll/related_posts.rb index 7c5a597d..ab13a968 100644 --- a/lib/jekyll/related_posts.rb +++ b/lib/jekyll/related_posts.rb @@ -24,26 +24,25 @@ module Jekyll end end + def build_index self.class.lsi ||= begin - puts "Starting the classifier..." lsi = Classifier::LSI.new(:auto_rebuild => false) - display(" Populating LSI... ") + display("\n Populating LSI... ") self.site.posts.each do |x| - display(".") lsi.add_item(x) end - display("\n Rebuilding LSI index... ") + display("\nRebuilding index... ") lsi.build_index - puts "" + display("") lsi end end def lsi_related_posts - lsi.find_related(post.content, 11) - [self.post] + self.class.lsi.find_related(post.content, 11) - [self.post] end def most_recent_posts @@ -54,6 +53,5 @@ module Jekyll $stdout.print(output) $stdout.flush end - end end