Class: CurationConcerns::Configuration

Inherits:
Object
  • Object
show all
Includes:
Callbacks
Defined in:
lib/curation_concerns/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#analytic_start_dateObject

Returns the value of attribute analytic_start_date.



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

def analytic_start_date
  @analytic_start_date
end

#analyticsObject

Returns the value of attribute analytics.



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

def analytics
  @analytics
end

#characterization_runnerObject

Override characterization runner



97
98
99
# File 'lib/curation_concerns/configuration.rb', line 97

def characterization_runner
  @characterization_runner
end

#default_antivirus_instanceObject



28
29
30
31
32
# File 'lib/curation_concerns/configuration.rb', line 28

def default_antivirus_instance
  @default_antivirus_instance ||= lambda do|_file_path|
    AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
  end
end

#derivatives_pathObject



36
37
38
# File 'lib/curation_concerns/configuration.rb', line 36

def derivatives_path
  @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives')
end

#enable_ffmpegObject



47
48
49
50
# File 'lib/curation_concerns/configuration.rb', line 47

def enable_ffmpeg
  return @enable_ffmpeg unless @enable_ffmpeg.nil?
  @enable_ffmpeg = false
end

#enable_local_ingestObject

Returns the value of attribute enable_local_ingest.



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

def enable_local_ingest
  @enable_local_ingest
end

#enable_noidsObject



68
69
70
71
# File 'lib/curation_concerns/configuration.rb', line 68

def enable_noids
  return @enable_noids unless @enable_noids.nil?
  @enable_noids = true
end

#ffmpeg_pathObject



53
54
55
# File 'lib/curation_concerns/configuration.rb', line 53

def ffmpeg_path
  @ffmpeg_path ||= 'ffmpeg'
end

#fits_message_lengthObject



58
59
60
# File 'lib/curation_concerns/configuration.rb', line 58

def fits_message_length
  @fits_message_length ||= 5
end

#fits_pathObject



92
93
94
# File 'lib/curation_concerns/configuration.rb', line 92

def fits_path
  @fits_path ||= 'fits.sh'
end

#fits_to_desc_mappingObject

Returns the value of attribute fits_to_desc_mapping.



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

def fits_to_desc_mapping
  @fits_to_desc_mapping
end

#lock_retry_countObject



103
104
105
# File 'lib/curation_concerns/configuration.rb', line 103

def lock_retry_count
  @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms
end

#lock_retry_delayObject



117
118
119
# File 'lib/curation_concerns/configuration.rb', line 117

def lock_retry_delay
  @lock_retry_delay ||= 200 # milliseconds
end

#lock_time_to_liveObject



110
111
112
# File 'lib/curation_concerns/configuration.rb', line 110

def lock_time_to_live
  @lock_time_to_live ||= 60_000 # milliseconds
end

#max_days_between_auditsObject

Returns the value of attribute max_days_between_audits.



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

def max_days_between_audits
  @max_days_between_audits
end

#minter_statefileObject



79
80
81
# File 'lib/curation_concerns/configuration.rb', line 79

def minter_statefile
  @minter_statefile ||= '/tmp/minter-state'
end

#noid_templateObject



74
75
76
# File 'lib/curation_concerns/configuration.rb', line 74

def noid_template
  @noid_template ||= '.reeddeeddk'
end

#owner_permission_levelsObject

Returns the value of attribute owner_permission_levels.



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

def owner_permission_levels
  @owner_permission_levels
end

#permission_levelsObject

Returns the value of attribute permission_levels.



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

def permission_levels
  @permission_levels
end

#queue=(value) ⇒ Object (writeonly)

Sets the attribute queue

Parameters:

  • value

    the value to set the attribute queue to.



88
89
90
# File 'lib/curation_concerns/configuration.rb', line 88

def queue=(value)
  @queue = value
end

#redis_namespaceObject



84
85
86
# File 'lib/curation_concerns/configuration.rb', line 84

def redis_namespace
  @redis_namespace ||= 'curation_concerns'
end

#resource_typesObject

Returns the value of attribute resource_types.



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

def resource_types
  @resource_types
end

#resource_types_to_schemaObject

Returns the value of attribute resource_types_to_schema.



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

def resource_types_to_schema
  @resource_types_to_schema
end

#temp_file_baseObject

Returns the value of attribute temp_file_base.



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

def temp_file_base
  @temp_file_base
end

#working_pathObject



42
43
44
# File 'lib/curation_concerns/configuration.rb', line 42

def working_path
  @working_path ||= File.join(Rails.root, 'tmp', 'uploads')
end

Instance Method Details

#curation_concernsObject

Returns the classes of the registered curation concerns



142
143
144
# File 'lib/curation_concerns/configuration.rb', line 142

def curation_concerns
  registered_curation_concern_types.map(&:constantize)
end

#register_curation_concern(*curation_concern_types) ⇒ Object



127
128
129
130
131
132
133
134
# File 'lib/curation_concerns/configuration.rb', line 127

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

#registered_curation_concern_typesObject

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



137
138
139
# File 'lib/curation_concerns/configuration.rb', line 137

def registered_curation_concern_types
  @registered_curation_concern_types ||= []
end