Sha256: 60ca043bd21d11c6b66d0de193983db46ca0f7e8168cccc2aec69338d68d7de8

Contents?: true

Size: 893 Bytes

Versions: 9

Compression:

Stored size: 893 Bytes

Contents

module Internals

  module Index

    class Files < Backend

      def initialize bundle_name, config
        super bundle_name, config

        # Note: We marshal the similarity, as the
        #       Yajl json lib cannot load symbolized
        #       values, just keys.
        #
        @index         = File::JSON.new    config.index_path(bundle_name, :index)
        @weights       = File::JSON.new    config.index_path(bundle_name, :weights)
        @similarity    = File::Marshal.new config.index_path(bundle_name, :similarity)
        @configuration = File::JSON.new    config.index_path(bundle_name, :configuration)
      end

      def to_s
        <<-FILES
Files:
#{"Index:      #{@index}".indented_to_s}
#{"Weights:    #{@weights}".indented_to_s}
#{"Similarity: #{@similarity}".indented_to_s}
#{"Config:     #{@configuration}".indented_to_s}
FILES
      end

    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
picky-2.1.2 lib/picky/internals/index/files.rb
picky-2.1.1 lib/picky/internals/index/files.rb
picky-2.1.0 lib/picky/internals/index/files.rb
picky-2.0.0 lib/picky/internals/index/files.rb
picky-2.0.0.pre3 lib/picky/internals/index/files.rb
picky-2.0.0.pre2 lib/picky/internals/index/files.rb
picky-2.0.0.pre1 lib/picky/internals/index/files.rb
picky-1.5.4 lib/picky/internals/index/files.rb
picky-1.5.3 lib/picky/internals/index/files.rb