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
-
#display_microdata ⇒ Object
Returns the value of attribute display_microdata.
- #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.
-
#microdata_default_type ⇒ Object
Returns the value of attribute microdata_default_type.
- #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.
- #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 ⇒ 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.
Constructor Details
#initialize ⇒ Configuration
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_date ⇒ Object
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 |
#analytics ⇒ Object
Returns the value of attribute analytics.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def analytics @analytics end |
#characterization_runner ⇒ Object
Override characterization runner
92 93 94 |
# File 'lib/curation_concerns/configuration.rb', line 92 def characterization_runner @characterization_runner end |
#default_antivirus_instance ⇒ Object
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_path ⇒ Object
33 34 35 |
# File 'lib/curation_concerns/configuration.rb', line 33 def derivatives_path @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives') end |
#display_microdata ⇒ Object
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_ffmpeg ⇒ Object
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_ingest ⇒ Object
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_noids ⇒ Object
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_path ⇒ Object
50 51 52 |
# File 'lib/curation_concerns/configuration.rb', line 50 def ffmpeg_path @ffmpeg_path ||= 'ffmpeg' end |
#fits_message_length ⇒ Object
55 56 57 |
# File 'lib/curation_concerns/configuration.rb', line 55 def ||= 5 end |
#fits_path ⇒ Object
87 88 89 |
# File 'lib/curation_concerns/configuration.rb', line 87 def fits_path @fits_path ||= 'fits.sh' end |
#fits_to_desc_mapping ⇒ Object
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_count ⇒ Object
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_delay ⇒ Object
112 113 114 |
# File 'lib/curation_concerns/configuration.rb', line 112 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
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_audits ⇒ Object
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_type ⇒ Object
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_statefile ⇒ Object
77 78 79 |
# File 'lib/curation_concerns/configuration.rb', line 77 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#noid_template ⇒ Object
72 73 74 |
# File 'lib/curation_concerns/configuration.rb', line 72 def noid_template @noid_template ||= '.reeddeeddk' end |
#owner_permission_levels ⇒ Object
Returns the value of attribute owner_permission_levels.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def end |
#permission_levels ⇒ Object
Returns the value of attribute permission_levels.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def end |
#redis_namespace ⇒ Object
82 83 84 |
# File 'lib/curation_concerns/configuration.rb', line 82 def redis_namespace @redis_namespace ||= 'curation_concerns' end |
#resource_types ⇒ Object
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_schema ⇒ Object
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_base ⇒ Object
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_path ⇒ Object
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_concerns ⇒ Array<Class>
Returns 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
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_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
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 |