The mighty classifier --- reborn!!!!!

Use classifier-reborn v2.0 in place of classifier 1.3.
Code at https://github.com/jekyll/classifier-reborn
This commit is contained in:
Parker Moore 2014-08-10 16:45:03 -04:00
parent f84cd4e4ed
commit 4d8e335da1
3 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,6 @@ Gem::Specification.new do |s|
# Before 3.0 drops, phase the following gems out as dev dependencies # Before 3.0 drops, phase the following gems out as dev dependencies
# and gracefully handle their absence. # and gracefully handle their absence.
s.add_runtime_dependency('classifier', "~> 1.3")
s.add_runtime_dependency('pygments.rb', "~> 0.6.0") s.add_runtime_dependency('pygments.rb', "~> 0.6.0")
s.add_runtime_dependency('redcarpet', "~> 3.1") s.add_runtime_dependency('redcarpet', "~> 3.1")
s.add_runtime_dependency('toml', '~> 0.1.0') s.add_runtime_dependency('toml', '~> 0.1.0')
@ -45,6 +44,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0') s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0')
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0') s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
s.add_runtime_dependency('jekyll-watch', '~> 1.1') s.add_runtime_dependency('jekyll-watch', '~> 1.1')
s.add_runtime_dependency('classifier-reborn', "~> 2.0")
s.add_development_dependency('rake', "~> 10.1") s.add_development_dependency('rake', "~> 10.1")
s.add_development_dependency('rdoc', "~> 3.11") s.add_development_dependency('rdoc', "~> 3.11")

View File

@ -10,7 +10,7 @@ module Jekyll
def initialize(post) def initialize(post)
@post = post @post = post
@site = post.site @site = post.site
require 'classifier' if site.lsi require 'classifier-reborn' if site.lsi
end end
def build def build
@ -27,7 +27,7 @@ module Jekyll
def build_index def build_index
self.class.lsi ||= begin self.class.lsi ||= begin
lsi = Classifier::LSI.new(:auto_rebuild => false) lsi = ClassifierReborn::LSI.new(:auto_rebuild => false)
display("Populating LSI...") display("Populating LSI...")
site.posts.each do |x| site.posts.each do |x|

View File

@ -36,8 +36,8 @@ class TestRelatedPosts < Test::Unit::TestCase
should "use lsi for the related posts" do should "use lsi for the related posts" do
@site.reset @site.reset
@site.read @site.read
require 'classifier' require 'classifier-reborn'
any_instance_of(::Classifier::LSI) do |c| any_instance_of(::ClassifierReborn::LSI) do |c|
stub(c).find_related { @site.posts[-1..-9] } stub(c).find_related { @site.posts[-1..-9] }
stub(c).build_index stub(c).build_index
end end