lib/picky/indexes_indexing.rb in picky-2.7.0 vs lib/picky/indexes_indexing.rb in picky-3.0.0.pre1

- old
+ new

@@ -1,46 +1,50 @@ -# Indexes indexing. -# -class Indexes +module Picky - instance_delegate :index, - :check, - :clear, - :backup, - :restore, - :index_for_tests, - :tokenizer + # Indexes indexing. + # + class Indexes - each_delegate :check, - :clear, - :backup, - :restore, - :to => :indexes + instance_delegate :index, + :check, + :clear, + :backup, + :restore, + :index_for_tests, + :tokenizer - # Runs the indexers in parallel (prepare + cache). - # - def index randomly = true - # Run in parallel. - # - timed_exclaim "Indexing using #{Cores.max_processors} processors, in #{randomly ? 'random' : 'given'} order." + each_delegate :check, + :clear, + :backup, + :restore, + :to => :indexes - # Run indexing/caching forked. + # Runs the indexers in parallel (prepare + cache). # - Cores.forked self.indexes, { randomly: randomly }, &:index + def index randomly = true + # Run in parallel. + # + timed_exclaim "Indexing using #{Cores.max_processors} processors, in #{randomly ? 'random' : 'given'} order." - timed_exclaim "Indexing finished." - end + # Run indexing/caching forked. + # + Cores.forked self.indexes, { randomly: randomly }, &:index - # For integration testing – indexes for the tests - # without forking and shouting ;) - # - def index_for_tests - indexes.each(&:index) - end + timed_exclaim "Indexing finished." + end - # TODO Doc. Spec. Split into Query/Index. - # - def tokenizer - Tokenizers::Index.default + # For integration testing – indexes for the tests + # without forking and shouting ;) + # + def index_for_tests + indexes.each(&:index) + end + + # + # + def tokenizer + Tokenizers::Index.default + end + end end \ No newline at end of file