lib/picky/backend/files.rb in picky-2.7.0 vs lib/picky/backend/files.rb in picky-3.0.0.pre1

- old
+ new

@@ -1,23 +1,27 @@ -module Backend +module Picky - class Files < Base + module Backend - def initialize bundle_name, category - super bundle_name, category + class Files < Base - # Note: We marshal the similarity, as the - # Yajl json lib cannot load symbolized - # values, just keys. - # - @inverted = File::JSON.new category.index_path(bundle_name, :inverted) - @weights = File::JSON.new category.index_path(bundle_name, :weights) - @similarity = File::Marshal.new category.index_path(bundle_name, :similarity) - @configuration = File::JSON.new category.index_path(bundle_name, :configuration) - end + def initialize bundle + super bundle - def to_s - "#{self.class}(#{[@prepared, @inverted, @weights, @similarity, @configuration].join(', ')})" + # Note: We marshal the similarity, as the + # Yajl json lib cannot load symbolized + # values, just keys. + # + @inverted = File::JSON.new bundle.index_path(:inverted) + @weights = File::JSON.new bundle.index_path(:weights) + @similarity = File::Marshal.new bundle.index_path(:similarity) + @configuration = File::JSON.new bundle.index_path(:configuration) + end + + def to_s + "#{self.class}(#{[@inverted, @weights, @similarity, @configuration].join(', ')})" + end + end end end \ No newline at end of file