Sha256: 8a3e6a511a258f696aaf60885a2dc8cbae357edd366d9e1bc23f40d3b5392711

Contents?: true

Size: 835 Bytes

Versions: 17

Compression:

Stored size: 835 Bytes

Contents

require 'pupa/processor/document_store/file_store'
require 'pupa/processor/document_store/redis_store'

module Pupa
  class Processor
    # An JSON document store factory.
    #
    # Heavily inspired by `ActiveSupport::Cache::Store`.
    class DocumentStore
      # Returns a configured JSON document store.
      #
      # See each document store for more information.
      #
      # @param [String] argument the filesystem directory or Redis address
      #   (e.g. `redis://localhost:6379/0`) in which to dump JSON documents
      # @param [Hash] options optional arguments
      # @return a configured JSON document store
      def self.new(argument, **options)
        if argument[%r{\Aredis://}]
          RedisStore.new(argument, options)
        else
          FileStore.new(argument)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pupa-0.2.4 lib/pupa/processor/document_store.rb
pupa-0.2.3 lib/pupa/processor/document_store.rb
pupa-0.2.2 lib/pupa/processor/document_store.rb
pupa-0.2.1 lib/pupa/processor/document_store.rb
pupa-0.2.0 lib/pupa/processor/document_store.rb
pupa-0.1.11 lib/pupa/processor/document_store.rb
pupa-0.1.10 lib/pupa/processor/document_store.rb
pupa-0.1.9 lib/pupa/processor/document_store.rb
pupa-0.1.8 lib/pupa/processor/document_store.rb
pupa-0.1.7 lib/pupa/processor/document_store.rb
pupa-0.1.6 lib/pupa/processor/document_store.rb
pupa-0.1.5 lib/pupa/processor/document_store.rb
pupa-0.1.4 lib/pupa/processor/document_store.rb
pupa-0.1.3 lib/pupa/processor/document_store.rb
pupa-0.1.2 lib/pupa/processor/document_store.rb
pupa-0.1.1 lib/pupa/processor/document_store.rb
pupa-0.1.0 lib/pupa/processor/document_store.rb