Sha256: 648af77c7492cc0608ccf2345c1973f1078745a0c42d7ca9ede3c303a439562b

Contents?: true

Size: 1.49 KB

Versions: 15

Compression:

Stored size: 1.49 KB

Contents

module Isomorfeus
  # available settings
  class << self
    def cached_data_classes
      @cached_data_classes ||= {}
    end

    def cached_data_class(class_name)
      return "::#{class_name}".constantize if Isomorfeus.development?
      return cached_data_classes[class_name] if cached_data_classes.key?(class_name)
      cached_data_classes[class_name] = "::#{class_name}".constantize
    end
  end
  
  if RUBY_ENGINE == 'opal'
    add_client_option(:api_files_path)
  else
    class << self
      def valid_data_classes
        @valid_data_classes ||= {}
      end

      def valid_data_class_name?(class_name)
        valid_data_classes.key?(class_name)
      end

      def add_valid_data_class(klass)
        valid_data_classes[raw_class_name(klass)] = true
      end

      attr_accessor :storage_path
      attr_accessor :files_path

      attr_accessor :ferret_path
      attr_accessor :data_documents_path

      attr_accessor :data_object_envs_path
      attr_accessor :data_object_idxs_path
      attr_accessor :api_files_path
    end

    self.storage_path = File.expand_path(File.join(Isomorfeus.root, 'storage', Isomorfeus.env))
    self.files_path = File.expand_path(File.join(self.storage_path, 'files'))

    # documents and indices
    self.ferret_path = File.expand_path(File.join(self.storage_path, 'ferret'))
    self.data_documents_path = File.expand_path(File.join(self.ferret_path, 'documents'))
  end

  self.api_files_path = '/files/'
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
isomorfeus-data-23.9.0.rc12 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc11 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc10 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc9 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc8 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc7 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc6 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc5 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc4 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc3 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc2 lib/isomorfeus/data/config.rb
isomorfeus-data-23.9.0.rc1 lib/isomorfeus/data/config.rb
isomorfeus-data-23.8.0.rc3 lib/isomorfeus/data/config.rb
isomorfeus-data-23.8.0.rc2 lib/isomorfeus/data/config.rb
isomorfeus-data-23.8.0.rc1 lib/isomorfeus/data/config.rb