Class: Curate::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/curate/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#application_root_urlObject



31
32
33
# File 'lib/curate/configuration.rb', line 31

def application_root_url
  @application_root_url || (raise RuntimeError.new("Make sure to set your Curate.configuration.application_root_url"))
end

#build_identifierObject



37
38
39
40
41
42
# File 'lib/curate/configuration.rb', line 37

def build_identifier
  # If you restart the server, this could be out of sync; A better
  # implementation is to read something from the file system. However
  # that detail is an exercise for the developer.
  @build_identifier ||= Time.now.strftime("%Y-%m-%d %H:%M:%S")
end

#characterization_runnerObject

Override characterization runner



45
46
47
# File 'lib/curate/configuration.rb', line 45

def characterization_runner
  @characterization_runner
end

#default_antivirus_instanceObject



17
18
19
20
21
# File 'lib/curate/configuration.rb', line 17

def default_antivirus_instance
  @default_antivirus_instance ||= lambda {|file_path|
    AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
  }
end

#search_configObject



25
26
27
# File 'lib/curate/configuration.rb', line 25

def search_config
  @search_config ||= "search_config not set"
end

Instance Method Details

#curation_concernsObject

Returns the classes of the registered curation concerns



62
63
64
# File 'lib/curate/configuration.rb', line 62

def curation_concerns
  registered_curation_concern_types.map(&:constantize)
end

#register_curation_concern(*curation_concern_types) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/curate/configuration.rb', line 47

def register_curation_concern(*curation_concern_types)
  Array(curation_concern_types).flatten.compact.each do |cc_type|
    class_name = ClassifyConcern.normalize_concern_name(cc_type)
    if ! registered_curation_concern_types.include?(class_name)
      self.registered_curation_concern_types << class_name
    end
  end
end

#registered_curation_concern_typesObject

Returns the class names (strings) of the registered curation concerns



57
58
59
# File 'lib/curate/configuration.rb', line 57

def registered_curation_concern_types
  @registered_curation_concern_types ||= []
end