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

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
# File 'lib/curation_concerns/configuration.rb', line 17

def initialize
  @registered_concerns = []
end

Instance Attribute Details

#analytic_start_dateObject

Returns the value of attribute analytic_start_date.



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

def analytic_start_date
  @analytic_start_date
end

#analyticsObject

Returns the value of attribute analytics.



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

def analytics
  @analytics
end

#characterization_runnerObject

Override characterization runner



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

def characterization_runner
  @characterization_runner
end

#default_antivirus_instanceObject



25
26
27
28
29
# File 'lib/curation_concerns/configuration.rb', line 25

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

#derivatives_pathObject



33
34
35
# File 'lib/curation_concerns/configuration.rb', line 33

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

#display_microdataObject

Returns the value of attribute display_microdata.



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

def display_microdata
  @display_microdata
end

#enable_ffmpegObject



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

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.



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

def enable_local_ingest
  @enable_local_ingest
end

#enable_noidsObject



66
67
68
69
# File 'lib/curation_concerns/configuration.rb', line 66

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

#ffmpeg_pathObject



50
51
52
# File 'lib/curation_concerns/configuration.rb', line 50

def ffmpeg_path
  @ffmpeg_path ||= 'ffmpeg'
end

#fits_message_lengthObject



55
56
57
# File 'lib/curation_concerns/configuration.rb', line 55

def fits_message_length
  @fits_message_length ||= 5
end

#fits_pathObject



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

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

#fits_to_desc_mappingObject

Returns the value of attribute fits_to_desc_mapping.



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

def fits_to_desc_mapping
  @fits_to_desc_mapping
end

#lock_retry_countObject



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

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

#lock_retry_delayObject



112
113
114
# File 'lib/curation_concerns/configuration.rb', line 112

def lock_retry_delay
  @lock_retry_delay ||= 200 # milliseconds
end

#lock_time_to_liveObject



105
106
107
# File 'lib/curation_concerns/configuration.rb', line 105

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.



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

def max_days_between_audits
  @max_days_between_audits
end

#microdata_default_typeObject

Returns the value of attribute microdata_default_type.



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

def microdata_default_type
  @microdata_default_type
end

#minter_statefileObject



77
78
79
# File 'lib/curation_concerns/configuration.rb', line 77

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

#noid_templateObject



72
73
74
# File 'lib/curation_concerns/configuration.rb', line 72

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

#owner_permission_levelsObject

Returns the value of attribute owner_permission_levels.



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

def owner_permission_levels
  @owner_permission_levels
end

#permission_levelsObject

Returns the value of attribute permission_levels.



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

def permission_levels
  @permission_levels
end

#redis_namespaceObject



82
83
84
# File 'lib/curation_concerns/configuration.rb', line 82

def redis_namespace
  @redis_namespace ||= 'curation_concerns'
end

#resource_typesObject

Returns the value of attribute resource_types.



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

def resource_types
  @resource_types
end

#resource_types_to_schemaObject

Returns the value of attribute resource_types_to_schema.



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

def resource_types_to_schema
  @resource_types_to_schema
end

#temp_file_baseObject

Returns the value of attribute temp_file_base.



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

def temp_file_base
  @temp_file_base
end

#working_pathObject



39
40
41
# File 'lib/curation_concerns/configuration.rb', line 39

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

Instance Method Details

#curation_concernsArray<Class>

Returns the registered curation concerns.

Returns:

  • (Array<Class>)

    the registered curation concerns



140
141
142
# File 'lib/curation_concerns/configuration.rb', line 140

def curation_concerns
  registered_curation_concern_types.map(&:constantize)
end

#register_curation_concern(*curation_concern_types) ⇒ Object

Registers the given curation concern model in the configuration

Parameters:

  • curation_concern_types (Array<Symbol>, Symbol)


124
125
126
127
128
129
130
# File 'lib/curation_concerns/configuration.rb', line 124

def register_curation_concern(*curation_concern_types)
  Array(curation_concern_types).flatten.compact.each do |cc_type|
    unless @registered_concerns.include?(cc_type)
      @registered_concerns << cc_type
    end
  end
end

#registered_curation_concern_typesArray<String>

The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb

Returns:

  • (Array<String>)

    the class names of the registered curation concerns



135
136
137
# File 'lib/curation_concerns/configuration.rb', line 135

def registered_curation_concern_types
  @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) }
end