From 41ec65a7a2c28f4cdb41218d804d9d664ce5d4ad Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 7 Jun 2011 06:41:55 +0200 Subject: [PATCH] - Polecat is now a module and can be included - a dependency to FileUtils was missing --- lib/polecat.rb | 6 +++++- lib/polecat/index_reader.rb | 2 +- lib/polecat/index_searcher.rb | 2 +- lib/polecat/index_writer.rb | 2 +- lib/polecat/query.rb | 2 +- lib/polecat/term.rb | 2 +- spec/polecat_spec.rb | 9 --------- spec/spec_helper.rb | 1 - 8 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 spec/polecat_spec.rb diff --git a/lib/polecat.rb b/lib/polecat.rb index 0c55dc1..2204385 100644 --- a/lib/polecat.rb +++ b/lib/polecat.rb @@ -1,4 +1,8 @@ -class Polecat +module Polecat + # stdlibs + require 'fileutils' + + # own libs require 'polecat/index_writer' require 'polecat/index_reader' require 'polecat/index_searcher' diff --git a/lib/polecat/index_reader.rb b/lib/polecat/index_reader.rb index 5902e29..f3d5771 100644 --- a/lib/polecat/index_reader.rb +++ b/lib/polecat/index_reader.rb @@ -1,4 +1,4 @@ -class Polecat +module Polecat # reads an index directory # # This class reads the content of an index directory and builds the diff --git a/lib/polecat/index_searcher.rb b/lib/polecat/index_searcher.rb index 1a74ae3..08726c2 100644 --- a/lib/polecat/index_searcher.rb +++ b/lib/polecat/index_searcher.rb @@ -1,4 +1,4 @@ -class Polecat +module Polecat # interface for searching an index # # Build on top of an Polecat::IndexReader, this class let's you search through diff --git a/lib/polecat/index_writer.rb b/lib/polecat/index_writer.rb index 0a1bf32..da9733f 100644 --- a/lib/polecat/index_writer.rb +++ b/lib/polecat/index_writer.rb @@ -1,4 +1,4 @@ -class Polecat +module Polecat # handles the writing of new documents to the index. # # This class is responsible for writing the documents to the index. It takes diff --git a/lib/polecat/query.rb b/lib/polecat/query.rb index aebf3c8..29440eb 100644 --- a/lib/polecat/query.rb +++ b/lib/polecat/query.rb @@ -1,4 +1,4 @@ -class Polecat +module Polecat # The Query manages a number of terms or queries which are set into a # relation. A relation is needed to say, which documents shall be # returned. diff --git a/lib/polecat/term.rb b/lib/polecat/term.rb index 16b54d7..ca176ae 100644 --- a/lib/polecat/term.rb +++ b/lib/polecat/term.rb @@ -1,4 +1,4 @@ -class Polecat +module Polecat class Term # the field name which should be found attr_reader :field diff --git a/spec/polecat_spec.rb b/spec/polecat_spec.rb deleted file mode 100644 index 0771e0e..0000000 --- a/spec/polecat_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') - -describe "Polecat" do - describe "#new" do - it "can be initialized" do - Polecat.new - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba82aa4..20622ce 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' -require 'fileutils' require 'polecat' require 'virtus'