Class: CurationConcerns::Configuration
- Inherits:
-
Object
- Object
- CurationConcerns::Configuration
- Includes:
- Callbacks
- Defined in:
- lib/curation_concerns/configuration.rb
Instance Attribute Summary collapse
-
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
-
#analytics ⇒ Object
Returns the value of attribute analytics.
-
#characterization_runner ⇒ Object
Override characterization runner.
- #default_antivirus_instance ⇒ Object
- #derivatives_path ⇒ Object
- #enable_ffmpeg ⇒ Object
-
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
- #enable_noids ⇒ Object
- #ffmpeg_path ⇒ Object
- #fits_message_length ⇒ Object
- #fits_path ⇒ Object
-
#fits_to_desc_mapping ⇒ Object
Returns the value of attribute fits_to_desc_mapping.
- #lock_retry_count ⇒ Object
- #lock_retry_delay ⇒ Object
- #lock_time_to_live ⇒ Object
-
#max_days_between_audits ⇒ Object
Returns the value of attribute max_days_between_audits.
- #minter_statefile ⇒ Object
- #noid_template ⇒ Object
-
#owner_permission_levels ⇒ Object
Returns the value of attribute owner_permission_levels.
-
#permission_levels ⇒ Object
Returns the value of attribute permission_levels.
-
#queue ⇒ Object
writeonly
Sets the attribute queue.
- #redis_namespace ⇒ Object
-
#resource_types ⇒ Object
Returns the value of attribute resource_types.
-
#resource_types_to_schema ⇒ Object
Returns the value of attribute resource_types_to_schema.
-
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
- #working_path ⇒ Object
Instance Method Summary collapse
-
#curation_concerns ⇒ Object
Returns the classes of the registered curation concerns.
- #register_curation_concern(*curation_concern_types) ⇒ Object
-
#registered_curation_concern_types ⇒ Object
Returns the class names (strings) of the registered curation concerns.
Instance Attribute Details
#analytic_start_date ⇒ Object
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 |
#analytics ⇒ Object
Returns the value of attribute analytics.
62 63 64 |
# File 'lib/curation_concerns/configuration.rb', line 62 def analytics @analytics end |
#characterization_runner ⇒ Object
Override characterization runner
97 98 99 |
# File 'lib/curation_concerns/configuration.rb', line 97 def characterization_runner @characterization_runner end |
#default_antivirus_instance ⇒ Object
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_path ⇒ Object
36 37 38 |
# File 'lib/curation_concerns/configuration.rb', line 36 def derivatives_path @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives') end |
#enable_ffmpeg ⇒ Object
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_ingest ⇒ Object
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_noids ⇒ Object
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_path ⇒ Object
53 54 55 |
# File 'lib/curation_concerns/configuration.rb', line 53 def ffmpeg_path @ffmpeg_path ||= 'ffmpeg' end |
#fits_message_length ⇒ Object
58 59 60 |
# File 'lib/curation_concerns/configuration.rb', line 58 def @fits_message_length ||= 5 end |
#fits_path ⇒ Object
92 93 94 |
# File 'lib/curation_concerns/configuration.rb', line 92 def fits_path @fits_path ||= 'fits.sh' end |
#fits_to_desc_mapping ⇒ Object
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_count ⇒ Object
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_delay ⇒ Object
117 118 119 |
# File 'lib/curation_concerns/configuration.rb', line 117 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
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_audits ⇒ Object
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_statefile ⇒ Object
79 80 81 |
# File 'lib/curation_concerns/configuration.rb', line 79 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#noid_template ⇒ Object
74 75 76 |
# File 'lib/curation_concerns/configuration.rb', line 74 def noid_template @noid_template ||= '.reeddeeddk' end |
#owner_permission_levels ⇒ Object
Returns the value of attribute owner_permission_levels.
62 63 64 |
# File 'lib/curation_concerns/configuration.rb', line 62 def @owner_permission_levels end |
#permission_levels ⇒ Object
Returns the value of attribute permission_levels.
62 63 64 |
# File 'lib/curation_concerns/configuration.rb', line 62 def @permission_levels end |
#queue=(value) ⇒ Object (writeonly)
Sets the attribute queue
88 89 90 |
# File 'lib/curation_concerns/configuration.rb', line 88 def queue=(value) @queue = value end |
#redis_namespace ⇒ Object
84 85 86 |
# File 'lib/curation_concerns/configuration.rb', line 84 def redis_namespace @redis_namespace ||= 'curation_concerns' end |
#resource_types ⇒ Object
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_schema ⇒ Object
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_base ⇒ Object
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_path ⇒ Object
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_concerns ⇒ Object
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_types ⇒ Object
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 |