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.
- #binaries_directory ⇒ Object
-
#characterization_runner ⇒ Object
Override characterization runner.
- #dashboard_configuration ⇒ Object
- #default_antivirus_instance ⇒ Object
- #derivatives_path ⇒ Object
- #descriptions_directory ⇒ Object
- #display_media_download_link ⇒ Object
- #display_microdata ⇒ 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
- #import_export_jar_file_path ⇒ Object
- #ingest_queue_name ⇒ Object
- #license_service_class ⇒ Object
- #lock_retry_count ⇒ Object
- #lock_retry_delay ⇒ Object
- #lock_time_to_live ⇒ Object
- #max_days_between_audits ⇒ Object
- #microdata_default_type ⇒ Object
- #minter_statefile ⇒ Object
- #noid_template ⇒ Object
-
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
- #translate_id_to_uri ⇒ Object
- #translate_uri_to_id ⇒ Object
- #working_path ⇒ Object
Instance Method Summary collapse
-
#curation_concerns ⇒ Array<Class>
The registered curation concerns.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration.
-
#registered_curation_concern_types ⇒ Array<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.
Methods included from Callbacks
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 |
# File 'lib/curation_concerns/configuration.rb', line 16 def initialize @registered_concerns = [] end |
Instance Attribute Details
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
58 59 60 |
# File 'lib/curation_concerns/configuration.rb', line 58 def analytic_start_date @analytic_start_date end |
#analytics ⇒ Object
Returns the value of attribute analytics.
58 59 60 |
# File 'lib/curation_concerns/configuration.rb', line 58 def analytics @analytics end |
#binaries_directory ⇒ Object
163 164 165 |
# File 'lib/curation_concerns/configuration.rb', line 163 def binaries_directory @binaries_directory ||= "tmp/binaries" end |
#characterization_runner ⇒ Object
Override characterization runner
115 116 117 |
# File 'lib/curation_concerns/configuration.rb', line 115 def characterization_runner @characterization_runner end |
#dashboard_configuration ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/curation_concerns/configuration.rb', line 170 def dashboard_configuration @dashboard_configuration ||= { menu: { index: {}, resource_details: {}, workflow: {}, workflow_roles: {} }, actions: { index: { partials: [ "total_objects_charts", "total_embargo_visibility" ] }, resource_details: { partials: [ "total_objects" ] }, workflow: { partials: [ "workflow" ] } }, data_sources: { resource_stats: CurationConcerns::ResourceStatisticsSource } } end |
#default_antivirus_instance ⇒ Object
24 25 26 27 28 |
# File 'lib/curation_concerns/configuration.rb', line 24 def default_antivirus_instance @default_antivirus_instance ||= lambda do |_file_path| AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE end end |
#derivatives_path ⇒ Object
32 33 34 |
# File 'lib/curation_concerns/configuration.rb', line 32 def derivatives_path @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives') end |
#descriptions_directory ⇒ Object
156 157 158 |
# File 'lib/curation_concerns/configuration.rb', line 156 def descriptions_directory @descriptions_directory ||= "tmp/descriptions" end |
#display_media_download_link ⇒ Object
104 105 106 107 |
# File 'lib/curation_concerns/configuration.rb', line 104 def display_media_download_link return @display_media_download_link unless @display_media_download_link.nil? @display_media_download_link = true end |
#display_microdata ⇒ Object
62 63 64 65 |
# File 'lib/curation_concerns/configuration.rb', line 62 def display_microdata return @display_microdata unless @display_microdata.nil? @display_microdata = true end |
#enable_ffmpeg ⇒ Object
43 44 45 46 |
# File 'lib/curation_concerns/configuration.rb', line 43 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.
58 59 60 |
# File 'lib/curation_concerns/configuration.rb', line 58 def enable_local_ingest @enable_local_ingest end |
#enable_noids ⇒ Object
78 79 80 81 |
# File 'lib/curation_concerns/configuration.rb', line 78 def enable_noids return @enable_noids unless @enable_noids.nil? @enable_noids = true end |
#ffmpeg_path ⇒ Object
49 50 51 |
# File 'lib/curation_concerns/configuration.rb', line 49 def ffmpeg_path @ffmpeg_path ||= 'ffmpeg' end |
#fits_message_length ⇒ Object
54 55 56 |
# File 'lib/curation_concerns/configuration.rb', line 54 def @fits_message_length ||= 5 end |
#fits_path ⇒ Object
110 111 112 |
# File 'lib/curation_concerns/configuration.rb', line 110 def fits_path @fits_path ||= 'fits.sh' end |
#import_export_jar_file_path ⇒ Object
149 150 151 |
# File 'lib/curation_concerns/configuration.rb', line 149 def import_export_jar_file_path @import_export_jar_file_path ||= "tmp/fcrepo-import-export.jar" end |
#ingest_queue_name ⇒ Object
142 143 144 |
# File 'lib/curation_concerns/configuration.rb', line 142 def ingest_queue_name @ingest_queue_name ||= :default end |
#license_service_class ⇒ Object
239 240 241 |
# File 'lib/curation_concerns/configuration.rb', line 239 def license_service_class @license_service_class ||= CurationConcerns::LicenseService end |
#lock_retry_count ⇒ Object
121 122 123 |
# File 'lib/curation_concerns/configuration.rb', line 121 def lock_retry_count @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms end |
#lock_retry_delay ⇒ Object
135 136 137 |
# File 'lib/curation_concerns/configuration.rb', line 135 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
128 129 130 |
# File 'lib/curation_concerns/configuration.rb', line 128 def lock_time_to_live @lock_time_to_live ||= 60_000 # milliseconds end |
#max_days_between_audits ⇒ Object
73 74 75 |
# File 'lib/curation_concerns/configuration.rb', line 73 def max_days_between_audits @max_days_between_audits ||= 7 end |
#microdata_default_type ⇒ Object
68 69 70 |
# File 'lib/curation_concerns/configuration.rb', line 68 def microdata_default_type @microdata_default_type ||= 'http://schema.org/CreativeWork' end |
#minter_statefile ⇒ Object
99 100 101 |
# File 'lib/curation_concerns/configuration.rb', line 99 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#noid_template ⇒ Object
94 95 96 |
# File 'lib/curation_concerns/configuration.rb', line 94 def noid_template @noid_template ||= '.reeddeeddk' end |
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
58 59 60 |
# File 'lib/curation_concerns/configuration.rb', line 58 def temp_file_base @temp_file_base end |
#translate_id_to_uri ⇒ Object
89 90 91 |
# File 'lib/curation_concerns/configuration.rb', line 89 def translate_id_to_uri @translate_id_to_uri ||= ActiveFedora::Noid.config.translate_id_to_uri end |
#translate_uri_to_id ⇒ Object
84 85 86 |
# File 'lib/curation_concerns/configuration.rb', line 84 def translate_uri_to_id @translate_uri_to_id ||= ActiveFedora::Noid.config.translate_uri_to_id end |
#working_path ⇒ Object
38 39 40 |
# File 'lib/curation_concerns/configuration.rb', line 38 def working_path @working_path ||= File.join(Rails.root, 'tmp', 'uploads') end |
Instance Method Details
#curation_concerns ⇒ Array<Class>
Returns the registered curation concerns.
227 228 229 |
# File 'lib/curation_concerns/configuration.rb', line 227 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
211 212 213 214 215 216 217 |
# File 'lib/curation_concerns/configuration.rb', line 211 def register_curation_concern(*curation_concern_types) Array.wrap(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_types ⇒ Array<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
222 223 224 |
# File 'lib/curation_concerns/configuration.rb', line 222 def registered_curation_concern_types @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) } end |